summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-07-16 14:56:15 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-07-16 14:56:15 +0200
commitec152ef8b76e52c2808a1ae5c774af4f42a0e2f1 (patch)
tree3c98b4bb6a73da34269ca9bcd686d7300992041d /archaeological_operations/tests.py
parent6d229540ac8fdc5e5da95de214927a0f654cf55e (diff)
downloadIshtar-ec152ef8b76e52c2808a1ae5c774af4f42a0e2f1.tar.bz2
Ishtar-ec152ef8b76e52c2808a1ae5c774af4f42a0e2f1.zip
Test administrativ act creation - improve test wizard
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 29a7fdb00..5b7f71e1b 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -648,3 +648,45 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):
def post_wizard(self):
self.assertEqual(models.Operation.objects.count(),
self.operation_number + 1)
+
+
+class OperationAdminActWizardCreationTest(WizardTest, OperationInitTest,
+ TestCase):
+ fixtures = [settings.ROOT_PATH +
+ '../fixtures/initial_data-auth-fr.json',
+ settings.ROOT_PATH +
+ '../ishtar_common/fixtures/initial_data-fr.json',
+ settings.ROOT_PATH +
+ '../archaeological_files/fixtures/initial_data.json',
+ settings.ROOT_PATH +
+ '../archaeological_operations/fixtures/initial_data-fr.json']
+ url_name = 'operation_administrativeactop'
+ wizard_name = 'operation_administrative_act_wizard'
+ steps = views.administrativeactop_steps
+ form_datas = [[
+ # data
+ {
+ 'selec-operation_administrativeactop': {
+ },
+ 'administrativeact-operation_administrativeactop': {
+ 'signature_date': str(datetime.date.today())
+ }
+ },
+ # ignored
+ []
+ ]]
+
+ def pre_wizard(self):
+ ope = self.get_default_operation()
+ self.operation_number = models.Operation.objects.count()
+ data = self.form_datas[0][0]
+ data['selec-operation_administrativeactop']['pk'] = ope.pk
+ act = models.ActType.objects.filter(intented_to='O').all()[0].pk
+
+ data['administrativeact-operation_administrativeactop'][
+ 'act_type'] = act
+ super(OperationAdminActWizardCreationTest, self).pre_wizard()
+
+ def post_wizard(self):
+ self.assertEqual(models.Operation.objects.count(),
+ self.operation_number + 1)