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:
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,
)
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"]