Commit a57a45ae authored by Florent Chehab's avatar Florent Chehab

Moved test_read

parent 77048105
......@@ -8,25 +8,11 @@ from django.conf import settings
class ModerationTestCase(WithUserTestCase):
def test_setting_ok(self):
self.assertTrue(settings.TESTING)
def moreSetUp(self):
self.api_moderation = '/api/test/moderation/'
def test_read(self):
"""
TODO à déplacer ailleur
Basic tests to check read access rights
"""
response = self.staff_client.get(self.api_moderation)
self.assertEqual(response.status_code, 200)
response = self.authenticated_client.get(self.api_moderation)
self.assertEqual(response.status_code, 200)
response = self.unauthenticated_client.get(self.api_moderation)
self.assertEqual(response.status_code, 403)
def test_setting_ok(self):
self.assertTrue(settings.TESTING)
@override_settings(MODERATION_ACTIVATED=True)
def test_moderation_activated(self):
......
from .withUserTestCase import WithUserTestCase
class ReadAccessTestCase(WithUserTestCase):
def moreSetUp(self):
self.api_moderation = '/api/test/moderation/'
def test_read(self):
"""
Basic tests to check read access rights
On MyModelViewset
"""
response = self.staff_client.get(self.api_moderation)
self.assertEqual(response.status_code, 200)
response = self.moderator_client.get(self.api_moderation)
self.assertEqual(response.status_code, 200)
response = self.authenticated_client.get(self.api_moderation)
self.assertEqual(response.status_code, 200)
response = self.unauthenticated_client.get(self.api_moderation)
self.assertEqual(response.status_code, 403)
Markdown is supported
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