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
commitc3b928b50cda4c087699fff50fd6e91dd75d2580 (patch)
treefb1c2133c08e1bdc3d1a087618c59776546ee266 /archaeological_finds/tests.py
parentbc959913ada31882c49bbfe510933edc9f043444 (diff)
downloadIshtar-c3b928b50cda4c087699fff50fd6e91dd75d2580.tar.bz2
Ishtar-c3b928b50cda4c087699fff50fd6e91dd75d2580.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):