From d3577c944b73dd80a30c74f0da33d65f33c72cd9 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 16 Jul 2016 14:56:15 +0200 Subject: Test administrativ act creation - improve test wizard --- archaeological_operations/tests.py | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'archaeological_operations/tests.py') 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) -- cgit v1.2.3