diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-11-21 10:46:58 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-11-21 10:46:58 +0100 |
commit | c410be9b3c3ba193ee8c233cc6a50d065d4090fd (patch) | |
tree | 7fe4800634a6079854d7ab10c782c79fce24ea10 /archaeological_operations/tests.py | |
parent | 9309d89a48cee876ef17213924b2cc0b026677f9 (diff) | |
download | Ishtar-c410be9b3c3ba193ee8c233cc6a50d065d4090fd.tar.bz2 Ishtar-c410be9b3c3ba193ee8c233cc6a50d065d4090fd.zip |
Custom forms: disable completly a form
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r-- | archaeological_operations/tests.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 9f07aff45..af6199774 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -1221,6 +1221,29 @@ class CustomFormTest(TestCase, OperationInitTest): msg="filter user - 'address' field not found on the modification " "wizard. It should not have been filtered.") + def test_enabled(self): + c = Client() + c.login(username=self.username, password=self.password) + + cls_wiz = OperationWizardModifTest + url = reverse(cls_wiz.url_name) + # first wizard step + step = 'selec-operation_modification' + cls_wiz.wizard_post(c, url, step, {'pk': self.operations[0].pk}) + + step = 'collaborators-operation_modification' + data = { + '{}{}-current_step'.format(cls_wiz.url_name, + cls_wiz.wizard_name): [step], + } + response = c.post(url, data) + self.assertNotEqual(response.status_code, 404) + CustomForm.objects.create( + name="Test2", form="operation-collaborators", available=True, + apply_to_all=True, enabled=False) + response = c.post(url, data) + self.assertEqual(response.status_code, 404) + class OperationSearchTest(TestCase, OperationInitTest): fixtures = FILE_FIXTURES |