diff options
-rw-r--r-- | archaeological_context_records/tests.py | 1 | ||||
-rw-r--r-- | archaeological_files/tests.py | 1 | ||||
-rw-r--r-- | archaeological_finds/tests.py | 7 | ||||
-rw-r--r-- | archaeological_operations/tests.py | 1 | ||||
-rw-r--r-- | archaeological_warehouse/tests.py | 1 | ||||
-rw-r--r-- | ishtar_common/tests.py | 18 |
6 files changed, 25 insertions, 4 deletions
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index 136b2e24f..1a4f7fa08 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -536,6 +536,7 @@ class ContextRecordTest(ContextRecordInit, TestCase): cr = models.ContextRecord.objects.get(pk=cr.pk) cr.test_obj = test_obj cr.label = "New label!" + cr._no_down_model_update = False cr.save() # verify the relevance of the update diff --git a/archaeological_files/tests.py b/archaeological_files/tests.py index 8e99f59b8..89a84f64f 100644 --- a/archaeological_files/tests.py +++ b/archaeological_files/tests.py @@ -693,6 +693,7 @@ class FileOperationTest(TestCase, OperationInitTest, FileInit): # no parcel on the file -> new parcels are copied from the # operation self.operation.associated_file = self.item + self.operation._no_down_model_update = False self.operation.save() self.assertEqual(self.item.parcels.count(), initial_nb + 10) # parcel owner well attached diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index c36327bae..8e1c3f970 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -283,7 +283,10 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase): url_name = "find_creation" wizard_name = "find_wizard" steps = views.find_creation_steps - redirect_url = "/find_modification/selec-find_modification?open_item=" "{last_id}" + redirect_url = [ + "/find_modification/selec-find_modification?open_item={last_id}", + "/find_modification/selecw-find_modification?open_item={last_id}", + ] model = models.Find form_datas = [ FormData( @@ -1178,6 +1181,7 @@ class FindTest(FindInit, TestCase): cr = ContextRecord.objects.get(pk=base_find.context_record.pk) cr.label = "new-label-too" cr.skip_history_when_saving = True + cr._no_down_model_update = False cr.save() base_find = models.BaseFind.objects.get(pk=base_find.pk) find = models.Find.objects.get(pk=find.pk) @@ -1187,6 +1191,7 @@ class FindTest(FindInit, TestCase): cr.operation.code_patriarche = "PAT" cr.operation.skip_history_when_saving = True + cr.operation._no_down_model_update = False cr.operation.save() base_find = models.BaseFind.objects.get(pk=base_find.pk) find = models.Find.objects.get(pk=find.pk) diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 068ec3057..4ce1a4cc2 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -2334,6 +2334,7 @@ class OperationTest(TestCase, OperationInitTest): operation = models.Operation.objects.get(pk=operation.pk) operation.code_patriarche = "666" + operation._no_down_model_update = False # strange bug in full test condition operation.save() cr = ContextRecord.objects.get(pk=cr.pk) self.assertIsNotNone(cr.cached_label) diff --git a/archaeological_warehouse/tests.py b/archaeological_warehouse/tests.py index 896014c0d..4290e2c42 100644 --- a/archaeological_warehouse/tests.py +++ b/archaeological_warehouse/tests.py @@ -1026,6 +1026,7 @@ class ContainerTest(FindInit, TestCase): warehouse = models.Warehouse.objects.get(pk=self.main_warehouse.pk) warehouse.name = "New name" warehouse.slug = "new-name" + warehouse._no_down_model_update = False warehouse.save() self.assertEqual(models.Container.objects.filter(need_update=True).count(), 1) self.assertEqual( diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 977c1bc26..6152f7799 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -599,7 +599,7 @@ class WizardTest(object): if idx == len(self.steps) - 1: # last form if not self.redirect_url: - redirect_url = "/{}/done".format(self.url_uri) + redirect_urls = ["/{}/done".format(self.url_uri)] else: dct = {"url_name": self.url_name, "url_uri": self.url_uri, "last_id": 0} form_key = "selec-" + self.url_name @@ -609,8 +609,20 @@ class WizardTest(object): q = self.model.objects if q.count(): dct["last_id"] = q.order_by("-pk").all()[0].pk - redirect_url = self.redirect_url.format(**dct) - self.assertRedirects(response, redirect_url) + if not isinstance(self.redirect_url, (list, tuple)): + redirect_urls = [self.redirect_url.format(**dct)] + else: + redirect_urls = [url.format(**dct) for url in self.redirect_url] + current_error, ok = None, False + for url in redirect_urls: + try: + self.assertRedirects(response, url) + ok = True + break + except AssertionError as err: + current_error = err + if not ok: + raise current_error return response def test_wizard(self): |