summaryrefslogtreecommitdiff
path: root/archaeological_finds/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-26 11:42:56 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-08-26 11:42:56 +0200
commit312c124961c819601c7f2125142cf4f2985c4b55 (patch)
tree7dd7b6e469a225d5abc267d533f393c7d7f4172d /archaeological_finds/tests.py
parentf878a28e3ec8bc284f36be5e5b9d5fa4cf38f862 (diff)
downloadIshtar-312c124961c819601c7f2125142cf4f2985c4b55.tar.bz2
Ishtar-312c124961c819601c7f2125142cf4f2985c4b55.zip
Tests: verify find index on MCC import
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r--archaeological_finds/tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index e6eafd3ed..1d5559dbb 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -312,6 +312,22 @@ class ImportFindTest(ImportTest, TestCase):
images = [f.image for f in models.Find.objects.all() if f.image.name]
self.assertEqual(len(images), 1)
+ # check index
+ bfs = list(models.BaseFind.objects.order_by("-pk").all())
+ for idx in range(4):
+ bf = bfs[idx]
+ expected_index = 4 - idx
+ self.assertEqual(
+ bf.index, expected_index,
+ "Bad index for imported base find: {} where {} is "
+ "expected".format(bf.index, expected_index))
+ f = bf.find.all()[0]
+ self.assertEqual(
+ f.index, expected_index,
+ "Bad index for imported find: {} where {} is expected".format(
+ f.index, expected_index
+ ))
+
class FindTest(FindInit, TestCase):
fixtures = FIND_FIXTURES