diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-20 18:43:34 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-20 18:43:34 +0100 | 
| commit | 3a0cca7dde313e0f9b523424f6d1633b9b4bb64c (patch) | |
| tree | b536c996e01c7a4b0f29f09c720d02d968053e29 /archaeological_finds/tests.py | |
| parent | d4b2e392c04b98932ea9c99bd1dba8ace9386502 (diff) | |
| download | Ishtar-3a0cca7dde313e0f9b523424f6d1633b9b4bb64c.tar.bz2 Ishtar-3a0cca7dde313e0f9b523424f6d1633b9b4bb64c.zip | |
Tests: get default find for treatment test
Diffstat (limited to 'archaeological_finds/tests.py')
| -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() | 
