From a0e4e9e8e3001c5fdb1eb1be42fe19223025f4da Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 28 Feb 2022 10:01:23 +0100 Subject: [PATCH 1/4] Update 'black' version --- core/views/forms.py | 26 ++++++++++++++++---------- pyproject.toml | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/core/views/forms.py b/core/views/forms.py index 955d3320..18081e01 100644 --- a/core/views/forms.py +++ b/core/views/forms.py @@ -118,11 +118,14 @@ class SelectFile(TextInput): attrs["class"] = "select_file" else: attrs = {"class": "select_file"} - output = '%(content)s
' % { - "content": super(SelectFile, self).render(name, value, attrs, renderer), - "title": _("Choose file"), - "name": name, - } + output = ( + '%(content)s
' + % { + "content": super(SelectFile, self).render(name, value, attrs, renderer), + "title": _("Choose file"), + "name": name, + } + ) output += ( '' + % { + "content": super(SelectUser, self).render(name, value, attrs, renderer), + "title": _("Choose user"), + "name": name, + } + ) output += ( '=1.0.0"] From 6c5db61a97c0ee919c0f08816dd844133051ddce Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 28 Feb 2022 09:57:41 +0100 Subject: [PATCH 2/4] eboutic: et_autoanswer: don't require 'Auto' to proceed checking the request --- eboutic/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eboutic/views.py b/eboutic/views.py index 05c91e68..abac99ef 100644 --- a/eboutic/views.py +++ b/eboutic/views.py @@ -252,8 +252,6 @@ class EtransactionAutoAnswer(View): if ( not "Amount" in request.GET.keys() or not "BasketID" in request.GET.keys() - or not "Auto" - in request.GET.keys() # If not in the request it means the payment has been refused or not "Error" in request.GET.keys() or not "Sig" in request.GET.keys() ): @@ -271,7 +269,10 @@ class EtransactionAutoAnswer(View): ) except: return HttpResponse("Bad signature", status=400) - if request.GET["Error"] == "00000": + # Payment authorized: + # * 'Error' is '00000' + # * 'Auto' is in the request + if request.GET["Error"] == "00000" and "Auto" in request.GET.keys(): try: with transaction.atomic(): b = ( From 05dd3ad642d576e55e28941987bbb92f4e59032b Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 28 Feb 2022 10:34:15 +0100 Subject: [PATCH 3/4] gitlab-ci: use poetry --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b295d9e..e5be0b74 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,13 +7,14 @@ test: - env - apt-get update - apt-get install -y gettext libxapian-dev libgraphviz-dev - - pip install .[testing] + - pip install poetry + - poetry install -E testing - mkdir -p /dev/shm/search_indexes - ln -s /dev/shm/search_indexes sith/search_indexes - - ./manage.py compilemessages - - coverage run ./manage.py test - - coverage html - - coverage report + - poetry run ./manage.py compilemessages + - poetry run coverage run ./manage.py test + - poetry run coverage html + - poetry run coverage report variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_tests" cache: From e4ddceabea672e1b7b6d0daeb51fefa364580da1 Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 28 Feb 2022 14:41:01 +0100 Subject: [PATCH 4/4] club: fix tests with inclusive translation --- club/tests.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/club/tests.py b/club/tests.py index 33e6016e..10ccde0c 100644 --- a/club/tests.py +++ b/club/tests.py @@ -161,10 +161,10 @@ class ClubTest(TestCase): response = self.client.get( reverse("club:club_members", kwargs={"club_id": self.bdf.id}) ) - self.assertTrue(response.status_code == 200) - self.assertTrue( - """Richard Batsbak\\n Vice-Pr\\xc3\\xa9sident""" - in str(response.content) + self.assertEqual(response.status_code, 200) + self.assertIn( + """Richard Batsbak\n Vice-Président⸱e""", + response.content.decode(), ) def test_create_add_user_to_club_from_richard_fail(self): @@ -369,14 +369,15 @@ class ClubTest(TestCase): response = self.client.get( reverse("club:club_members", kwargs={"club_id": self.bdf.id}) ) - self.assertTrue(response.status_code == 200) - content = str(response.content) - self.assertTrue( - "Richard Batsbak\\n Curieux" in content + self.assertEqual(response.status_code, 200) + content = response.content.decode() + self.assertIn( + "Richard Batsbak\n Curieux⸱euse", + content, ) - self.assertTrue( - "S' Kia\\n Responsable info" - in content + self.assertIn( + "S' Kia\n Responsable info", + content, )