1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-07-04 12:52:15 +02:00

Add admin pages for registration app

This commit is contained in:
Yohann D'ANELLO
2020-10-06 13:35:05 +02:00
parent 5c76e5f0db
commit 798c8db781
3 changed files with 42 additions and 5 deletions

View File

@ -28,6 +28,22 @@ class TestRegistration(TestCase):
self.coach = User.objects.create(email="coach@example.com")
CoachRegistration.objects.create(user=self.coach, professional_activity="Teacher")
def test_admin_pages(self):
response = self.client.get(reverse("admin:index") + "registration/registration/")
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("admin:index")
+ f"registration/registration/{self.user.registration.pk}/change/")
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("admin:index")
+ f"registration/registration/{self.student.registration.pk}/change/")
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("admin:index")
+ f"registration/registration/{self.coach.registration.pk}/change/")
self.assertEqual(response.status_code, 200)
def test_registration(self):
response = self.client.get(reverse("registration:signup"))
self.assertEqual(response.status_code, 200)
@ -182,9 +198,5 @@ class TestRegistration(TestCase):
def test_string_render(self):
# TODO These string field tests will be removed when used in a template
str(self.user.registration)
self.assertRaises(NotImplementedError, lambda: Registration().type)
self.assertRaises(NotImplementedError, lambda: Registration().form_class)
str(StudentRegistration().type)
str(CoachRegistration().type)
str(self.user.registration.type) # AdminRegistration