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.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index d5f1fdb62..806696d4c 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -657,7 +657,7 @@ class FindSearchTest(FindInit, TestCase):
self.password)
self.client = Client()
- def testMaterialTypeHierarchicSearch(self):
+ def test_material_type_hierarchic_search(self):
find = self.finds[0]
c = Client()
metal = models.MaterialType.objects.get(txt_idx='metal')
@@ -665,6 +665,8 @@ class FindSearchTest(FindInit, TestCase):
not_iron_metal = models.MaterialType.objects.get(
txt_idx='not_iron_metal')
find.material_types.add(iron_metal)
+ find = models.Find.objects.get(pk=find.pk)
+ find.save()
search = {'material_types': iron_metal.pk}
@@ -680,7 +682,7 @@ class FindSearchTest(FindInit, TestCase):
content = response.content.decode()
res = json.loads(content)
self.assertEqual(res['recordsTotal'], 1)
- self.assertEqual(res["rows"][0]["material_types"],
+ self.assertEqual(res["rows"][0]["cached_materials"],
str(iron_metal))
# no result for the brother
@@ -731,6 +733,8 @@ class FindSearchTest(FindInit, TestCase):
period=final_neo
)
find.datings.add(dating)
+ find = models.Find.objects.get(pk=find.pk)
+ find.save()
search = {'datings__period': final_neo.pk}