mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 17:42:24 +00:00
Adapt search tests since the simple backend is not so permissive as ElasticSearch
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
dc56396012
commit
8222f3b781
@ -413,9 +413,7 @@ class TestRegistration(TestCase):
|
|||||||
"""
|
"""
|
||||||
Try to search some things.
|
Try to search some things.
|
||||||
"""
|
"""
|
||||||
call_command("rebuild_index", "--noinput", "-v", 0)
|
response = self.client.get(reverse("haystack_search") + "?q=" + self.user.last_name)
|
||||||
|
|
||||||
response = self.client.get(reverse("haystack_search") + "?q=" + self.user.email)
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertTrue(response.context["object_list"])
|
self.assertTrue(response.context["object_list"])
|
||||||
|
|
||||||
@ -425,6 +423,6 @@ class TestRegistration(TestCase):
|
|||||||
self.assertTrue(response.context["object_list"])
|
self.assertTrue(response.context["object_list"])
|
||||||
|
|
||||||
response = self.client.get(reverse("haystack_search") + "?q=" +
|
response = self.client.get(reverse("haystack_search") + "?q=" +
|
||||||
self.student.registration.get_student_class_display())
|
self.student.registration.school)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertTrue(response.context["object_list"])
|
self.assertTrue(response.context["object_list"])
|
||||||
|
@ -207,8 +207,6 @@ HAYSTACK_CONNECTIONS = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
|
||||||
|
|
||||||
_db_type = os.getenv('DJANGO_DB_TYPE', 'sqlite').lower()
|
_db_type = os.getenv('DJANGO_DB_TYPE', 'sqlite').lower()
|
||||||
|
|
||||||
if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql': # pragma: no cover
|
if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql': # pragma: no cover
|
||||||
|
@ -47,3 +47,5 @@ HAYSTACK_CONNECTIONS = {
|
|||||||
'INDEX_NAME': 'haystack',
|
'INDEX_NAME': 'haystack',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
||||||
|
Loading…
Reference in New Issue
Block a user