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:
@ -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
|
||||
|
Reference in New Issue
Block a user