Commit efdcae52 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

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.
parent 6681c078
Pipeline #38100 passed with stages
in 19 minutes and 7 seconds
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment