diff options
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/tests.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index bfe8e3b11..5980a931a 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -193,7 +193,7 @@ class ImportTest(object): "associated_group": group.pk, "csv_sep": sep, } - form = forms_common.BaseImportForm( + form = forms_common.NewImportForm( data=post_dict, files=file_dict, user=self.user ) form.is_valid() @@ -1800,9 +1800,11 @@ class ParcelTest(ImportTest, TestCase): post_response = c.post("/operation-parcels-modify/" + str(operation.pk) + "/", data) self.assertEqual(post_response.status_code, 200) - self.assertContains(post_response, _("This parcel is associated with a context " - "record. It can't be deleted.") # How to convert ''' to ' ? - ) + res = post_response.content.decode("utf8") + expected = str( + _("This parcel is associated with a context record. It can't be deleted.") + ).replace("'", "'") + self.assertIn(expected, res) parcels = models.Parcel.objects.all() self.assertEqual(parcels.count(), 1) @@ -2675,7 +2677,7 @@ class CustomFormTest(TestCase, OperationInitTest): step = "selec-operation_modification" cls_wiz.wizard_post(c, url, step, {"pk": self.operations[0].pk}) - step = "collaborators-operation_modification" + step = "relations-operation_modification" data = { "{}{}-current_step".format(cls_wiz.url_name, cls_wiz.wizard_name): [step], } @@ -2683,7 +2685,7 @@ class CustomFormTest(TestCase, OperationInitTest): self.assertNotEqual(response.status_code, 404) CustomForm.objects.create( name="Test2", - form="operation-020-collaborators", + form="operation-080-relations", available=True, apply_to_all=True, enabled=False, @@ -4693,7 +4695,7 @@ class ApiTest(OperationInitTest, APITestCase): response = self.client.post(url, params, follow=True) self.assertIn( - str(_("is not a valid JSON message")), + str(_("is not a valid JSON message")).replace("'", "'"), response.content.decode(), ) |