summaryrefslogtreecommitdiff
path: root/archaeological_finds/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r--archaeological_finds/tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 34f95cf7d..f0112123b 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -367,7 +367,10 @@ class FindSearchTest(FindInit, TestCase):
# one result for exact search
response = c.get(reverse('get-find'), search)
self.assertEqual(response.status_code, 200)
- self.assertTrue(json.loads(response.content)['total'] == 1)
+ res = json.loads(response.content)
+ self.assertTrue(res['total'] == 1)
+ self.assertEqual(res["rows"][0]["material_types__label"],
+ unicode(iron_metal))
# no result for the brother
search = {'material_types': not_iron_metal.pk}
@@ -404,7 +407,10 @@ class FindSearchTest(FindInit, TestCase):
c.login(username=self.username, password=self.password)
response = c.get(reverse('get-find'), search)
self.assertEqual(response.status_code, 200)
- self.assertEqual(json.loads(response.content)['total'], 1)
+ res = json.loads(response.content)
+ self.assertTrue(res['total'] == 1)
+ self.assertEqual(res["rows"][0]["datings__period__label"],
+ unicode(final_neo))
# no result for the brother
search = {'datings__period': recent_neo.pk}