From efdcae52527925ea87ce8cfd7a64febdd6e81987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20M=C3=A9nager?= <herve.menager@pasteur.fr> Date: Tue, 22 Sep 2020 17:21:29 +0200 Subject: [PATCH] correct contribution tests by setting proper init values otherwise depending on the order in which the tests run, some of them would randomly crash because livesettings had been modified by a previous test. --- ippisite/ippidb/tests/tests_contribute.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ippisite/ippidb/tests/tests_contribute.py b/ippisite/ippidb/tests/tests_contribute.py index 5ecf48a3..4638c657 100644 --- a/ippisite/ippidb/tests/tests_contribute.py +++ b/ippisite/ippidb/tests/tests_contribute.py @@ -47,6 +47,7 @@ class ContributionViewsAccessTestCase(TestCase): ) def test_403_without_perm_and_access_closed(self): + live_settings.open_access_to_contribution = "False" self.client.force_login(self.user) response = self.client.get(self.url) self.assertEqual(response.status_code, 403) @@ -80,6 +81,7 @@ class ContributionViewsAccessTestCase(TestCase): self.assertEqual(response.status_code, 302) def test_ko_with_staff(self): + live_settings.open_access_to_contribution = "False" self.user.is_staff = True self.user.save() self.client.force_login(self.user) -- GitLab