From 9890d6517858f7ddae67fdc6fcd0c4ee63838988 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Wed, 30 Mar 2022 11:02:24 +0100 Subject: [PATCH] update black version in linter to stop unicodefun import error 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: https://github.com/psf/black/issues/2171 --- .github/workflows/black.yml | 2 +- caps/tests/test_views.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 1c01a3287..fc70c5bfb 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -11,4 +11,4 @@ jobs: with: options: "--check --diff" src: "." - version: "21.12b0" \ No newline at end of file + version: "22.3.0" diff --git a/caps/tests/test_views.py b/caps/tests/test_views.py index 3a774f66b..b47a5f138 100644 --- a/caps/tests/test_views.py +++ b/caps/tests/test_views.py @@ -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 @@ -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): @@ -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", )