diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-08-22 18:25:53 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-08-22 18:37:29 +0200 | 
| commit | ce71152fcae3a25b9cadfd8a4a561829e3296d3c (patch) | |
| tree | 5d49cc534771a2ec84d8bd33a01fda83aaee1787 /archaeological_operations/tests.py | |
| parent | 8b116164320adbcefab1f5a10a4a401f897ef578 (diff) | |
| download | Ishtar-ce71152fcae3a25b9cadfd8a4a561829e3296d3c.tar.bz2 Ishtar-ce71152fcae3a25b9cadfd8a4a561829e3296d3c.zip | |
Operations - archaeological files: fix closing info (refs #3175)
Diffstat (limited to 'archaeological_operations/tests.py')
| -rw-r--r-- | archaeological_operations/tests.py | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 2bf3a6691..a8d627dd5 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -692,6 +692,31 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):                           self.operation_number + 1) +class OperationWizardClosingTest(OperationWizardCreationTest): +    fixtures = OperationWizardCreationTest.fixtures +    url_name = 'operation_closing' +    wizard_name = 'operation_closing_wizard' +    steps = views.operation_closing_steps +    form_datas = [[ +        { +            'selec-operation_closing': {'pk': None}, +            'date-operation_closing': {'end_date': '2016-01-01'}, +        }, []]] + +    def pre_wizard(self): +        self.ope = self.get_default_operation() +        self.form_datas[0][0]['selec-operation_closing']['pk'] = self.ope.pk +        self.assertTrue(self.ope.is_active()) +        super(OperationWizardClosingTest, self).pre_wizard() + +    def post_wizard(self): +        ope = models.Operation.objects.get(pk=self.ope.pk) +        self.assertFalse(ope.is_active()) +        self.assertEqual( +            ope.closing()['date'].strftime('%Y-%d-%m'), +            self.form_datas[0][0]['date-operation_closing']['end_date']) + +  class OperationAdminActWizardCreationTest(WizardTest, OperationInitTest,                                            TestCase):      fixtures = [settings.ROOT_PATH + | 
