diff options
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 |
commit | 312c124961c819601c7f2125142cf4f2985c4b55 (patch) | |
tree | 7dd7b6e469a225d5abc267d533f393c7d7f4172d /archaeological_finds/tests.py | |
parent | f878a28e3ec8bc284f36be5e5b9d5fa4cf38f862 (diff) | |
download | Ishtar-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.py | 16 |
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 |