summaryrefslogtreecommitdiff
path: root/archaeological_finds/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-24 19:34:27 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-24 19:37:02 +0200
commit73eedc117776ad42e2241232ad1dcc547cb967b2 (patch)
treefb1c2133c08e1bdc3d1a087618c59776546ee266 /archaeological_finds/tests.py
parent8fa0f928e68e10d4ef055bf9afd47e0e91ce7b55 (diff)
downloadIshtar-73eedc117776ad42e2241232ad1dcc547cb967b2.tar.bz2
Ishtar-73eedc117776ad42e2241232ad1dcc547cb967b2.zip
Datings: post-fix of duplicates associated to the same object (usually on imports)
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r--archaeological_finds/tests.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 41e113245..86c7936ba 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -123,6 +123,11 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
'period': None,
'start_date': '0',
'end_date': '200',
+ },
+ {
+ 'period': None,
+ 'start_date': '0',
+ 'end_date': '200',
}
]
},
@@ -135,8 +140,11 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
self.form_datas[0].form_datas['selecrecord-find_creation']['pk'] = \
cr.pk
+ period = Period.objects.all()[0].pk
self.form_datas[0].form_datas['dating-find_creation'][0]['period'] = \
- Period.objects.all()[0].pk
+ period
+ self.form_datas[0].form_datas['dating-find_creation'][1]['period'] = \
+ period
self.find_number = models.Find.objects.count()
self.basefind_number = models.BaseFind.objects.count()
super(FindWizardCreationTest, self).pre_wizard()
@@ -146,6 +154,9 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):
self.basefind_number + 1)
self.assertEqual(models.Find.objects.count(),
self.find_number + 1)
+ # identical datings, only one should be finaly save
+ f = models.Find.objects.order_by("-pk").all()[0]
+ self.assertEqual(f.datings.count(), 1)
class FindWizardDeletionWithWarehouseModTest(WizardTest, FindInit, TestCase):