diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-07-09 16:33:31 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-07-09 16:33:31 +0200 |
commit | 9f08d1f09a63c1445aac8b4afe015f4d88391501 (patch) | |
tree | d14baf02e1778fbea2103d025ebd4f2bc9c67eb9 | |
parent | 77c3070f669854e06196dd1220d747b44942e210 (diff) | |
download | Ishtar-9f08d1f09a63c1445aac8b4afe015f4d88391501.tar.bz2 Ishtar-9f08d1f09a63c1445aac8b4afe015f4d88391501.zip |
Tests: fix operation creation wizard
-rw-r--r-- | archaeological_operations/tests.py | 6 | ||||
-rw-r--r-- | archaeological_operations/wizards.py | 2 | ||||
-rw-r--r-- | ishtar_common/tests.py | 1 |
3 files changed, 4 insertions, 5 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 2e6914b6c..8b0b81571 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -1196,10 +1196,10 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase): file = FI.item file.towns.add(town) parcel = models.Parcel.objects.create( - town=town, year=2017, section='S', parcel_number='42' + town=town, year=2017, section='G', parcel_number='43' ) file.parcels.add(parcel) - self.form_datas[2].set('filechoice', 'pk', file.pk) + self.form_datas[2].set('filechoice', 'associated_file', file.pk) self.form_datas[2].append('towns', town_data) self.form_datas[2].append('parcels', {'parcel': parcel.pk}) @@ -1211,7 +1211,7 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase): self.assertEqual(models.Operation.objects.count(), self.operation_number + 3) self.assertEqual(models.Parcel.objects.count(), - self.parcel_number + 2) + self.parcel_number + 3) class OperationWizardModifTest(WizardTest, OperationInitTest, TestCase): diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index b9ff96cad..02d462f66 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -506,7 +506,7 @@ def has_associated_file(form_name, file_key='associated_file', negate=False): 'step_data'][form_name][form_name + '-' + file_key] if type(file_id) in (list, tuple): file_id = file_id[0] - file_id = int(file_id) + int(file_id) return not negate except ValueError: return negate diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index c77f3d1b5..6dee5927f 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -137,7 +137,6 @@ class WizardTestFormData(object): if suffix in form_name: continue self.form_datas[form_name + suffix] = self.form_datas.pop(form_name) - for pre in self.pre_tests: pre(test_object) |