diff options
-rw-r--r-- | archaeological_finds/tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 20c0604d5..7a2485fc1 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -62,7 +62,9 @@ class FindInit(ContextRecordInit): self.finds.append(find) return self.finds, self.base_finds - def get_default_find(self): + def get_default_find(self, force=False): + if force: + return self.create_finds()[-1] return self.create_finds()[0] def tearDown(self): @@ -188,7 +190,11 @@ class ATreatmentWizardCreationTest(WizardTest, FindInit, TestCase): person.id = 1 person.save() if not models.Find.objects.filter(pk=1).count(): - self.create_finds({"pk": 1, "label": u"Find 1"}, force=True) + find = self.get_default_find(force=True) + self.form_datas[0].form_datas['selecfind-treatment_creation'][ + 'pk'] = find.pk + self.form_datas[0].form_datas['selecfind-treatment_creation'][ + 'resulting_pk'] = find.pk self.treatment_number = models.Treatment.objects.count() super(ATreatmentWizardCreationTest, self).pre_wizard() |