Skip to content

Commit

Permalink
update black version in linter to stop unicodefun import error
Browse files Browse the repository at this point in the history
see
https://stackoverflow.com/questions/71673404/importerror-cannot-import-name-unicodefun-from-click
for details

Also includes a change to test_views to account for black normalising
string prefix order: psf/black#2171
  • Loading branch information
struan committed Apr 5, 2022
1 parent ef5d309 commit 2c7419f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
with:
options: "--check --diff"
src: "."
version: "21.12b0"
version: "22.3.0"
6 changes: 3 additions & 3 deletions caps/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_council_has_promise(self):
url = reverse("council", args=["borsetshire"])
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertRegex(response.content, br"this is a promise")
self.assertRegex(response.content, rb"this is a promise")

def test_council_has_no_promise(self):
self.promise.has_promise = False
Expand All @@ -171,7 +171,7 @@ def test_council_has_no_promise(self):
self.assertEqual(response.status_code, 200)
self.assertRegex(
response.content,
br"We couldn\xe2\x80\x99t find any climate pledges from this council",
rb"We couldn\xe2\x80\x99t find any climate pledges from this council",
)

def test_council_no_promise_data(self):
Expand All @@ -181,5 +181,5 @@ def test_council_no_promise_data(self):
self.assertEqual(response.status_code, 200)
self.assertRegex(
response.content,
br"checked whether this council has made any climate pledges",
rb"checked whether this council has made any climate pledges",
)

0 comments on commit 2c7419f

Please sign in to comment.