summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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