summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
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
commitcad971cb0b9bac402e379346ae24a17e5d11d313 (patch)
treed14baf02e1778fbea2103d025ebd4f2bc9c67eb9 /archaeological_operations
parent0e1a9779edb4268ba84f0202c85fa4540c1e2341 (diff)
downloadIshtar-cad971cb0b9bac402e379346ae24a17e5d11d313.tar.bz2
Ishtar-cad971cb0b9bac402e379346ae24a17e5d11d313.zip
Tests: fix operation creation wizard
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/tests.py6
-rw-r--r--archaeological_operations/wizards.py2
2 files changed, 4 insertions, 4 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