Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!17Prepare v1.0.1
Pipeline #38100 passed
...@@ -47,6 +47,7 @@ class ContributionViewsAccessTestCase(TestCase): ...@@ -47,6 +47,7 @@ class ContributionViewsAccessTestCase(TestCase):
) )
def test_403_without_perm_and_access_closed(self): def test_403_without_perm_and_access_closed(self):
live_settings.open_access_to_contribution = "False"
self.client.force_login(self.user) self.client.force_login(self.user)
response = self.client.get(self.url) response = self.client.get(self.url)
self.assertEqual(response.status_code, 403) self.assertEqual(response.status_code, 403)
...@@ -80,6 +81,7 @@ class ContributionViewsAccessTestCase(TestCase): ...@@ -80,6 +81,7 @@ class ContributionViewsAccessTestCase(TestCase):
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
def test_ko_with_staff(self): def test_ko_with_staff(self):
live_settings.open_access_to_contribution = "False"
self.user.is_staff = True self.user.is_staff = True
self.user.save() self.user.save()
self.client.force_login(self.user) self.client.force_login(self.user)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment