Fix basic search tests

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-01-13 19:24:55 +01:00
parent 121e1da37d
commit 5d13d9bc16
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 5 additions and 3 deletions

View File

@ -413,16 +413,18 @@ class TestRegistration(TestCase):
"""
Try to search some things.
"""
response = self.client.get(reverse("haystack_search") + "?q=" + self.user.last_name)
response = self.client.get(reverse("haystack_search") + "?q=" + self.user.email + "&models=auth.user")
self.assertEqual(response.status_code, 200)
self.assertTrue(response.context["object_list"])
response = self.client.get(reverse("haystack_search") + "?q=" +
str(self.coach.registration.professional_activity))
str(self.coach.registration.professional_activity)
+ "&models=registration.CoachRegistration")
self.assertEqual(response.status_code, 200)
self.assertTrue(response.context["object_list"])
response = self.client.get(reverse("haystack_search") + "?q=" +
self.student.registration.school)
self.student.registration.school + "&models=registration.StudentRegistration")
self.assertEqual(response.status_code, 200)
self.assertTrue(response.context["object_list"])