diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-03-09 15:58:12 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-06-17 13:21:27 +0200 |
commit | 17107d80e46987327741529fe07e6fccba27c302 (patch) | |
tree | 0a765dbfd1877003c31199df7a8d3c634c879427 /ishtar_common | |
parent | e05b9c69dc16f9782bcf3f3be9670a3097b4ca51 (diff) | |
download | Ishtar-17107d80e46987327741529fe07e6fccba27c302.tar.bz2 Ishtar-17107d80e46987327741529fe07e6fccba27c302.zip |
Fix document deletion - tests
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/tests.py | 7 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 03f8e3a69..9f97fd33b 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -330,6 +330,7 @@ class ManagedModelTestRunner(DiscoverRunner): class WizardTest(object): url_name = None + url_uri = None wizard_name = '' steps = None condition_dict = None @@ -416,7 +417,7 @@ class WizardTest(object): next_form = self.steps[idx + 1][0] self.assertRedirects( response, - '/{}/{}'.format(self.url_name, next_form), + '/{}/{}'.format(self.url_uri, next_form), msg_prefix="Dataset n{} Redirection to {} has failed - " "Error on previous form ({})?".format( data_idx + 1, next_form, current_step) @@ -425,13 +426,15 @@ class WizardTest(object): # last form self.assertRedirects( response, - '/{}/done'.format(self.url_name)) + '/{}/done'.format(self.url_uri)) return response def test_wizard(self): if self.pass_test(): return url = reverse(self.url_name) + if not self.url_uri: + self.url_uri = self.url_name self.pre_wizard() for data_idx, test_form_data in enumerate(self.form_datas): test_form_data.inits(self) diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index b5fe507b0..375004e67 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1495,6 +1495,7 @@ class DeletionWizard(Wizard): if (not hasattr(self, 'fields') or not self.fields) and \ (hasattr(self, 'model') and hasattr(self.model, 'TABLE_COLS')): self.fields = self.model.TABLE_COLS + assert self.model return super(DeletionWizard, self).__init__(*args, **kwargs) def get_formated_datas(self, forms): @@ -1812,6 +1813,7 @@ class SourceWizard(Wizard): class DocumentDeletionWizard(DeletionWizard): + model = models.Document fields = [ f.name for f in models.Document._meta.get_fields() if f.name != 'id' and f.name not in models.Document.RELATED_MODELS] |