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 | 4ea7107c362f02040cf07f53ead6578e1cc68afa (patch) | |
| tree | 7dd7b6e469a225d5abc267d533f393c7d7f4172d | |
| parent | bc7b3401b6c204ec1c1711df1565b90c1c1af3ba (diff) | |
| download | Ishtar-4ea7107c362f02040cf07f53ead6578e1cc68afa.tar.bz2 Ishtar-4ea7107c362f02040cf07f53ead6578e1cc68afa.zip | |
Tests: verify find index on MCC import
| -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 | 
