diff options
author | Cefin <kevon@tuta.io> | 2022-02-07 15:02:34 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:21:00 +0100 |
commit | 3fe67a45969934464e9b1ee775d63dc74005ba48 (patch) | |
tree | 5023bf60a9bb5840d20e183f0e0f1d3ade73fc7d /archaeological_operations/tests.py | |
parent | 3ad8d3809527c350418af65543d4f9bb5f40e79e (diff) | |
download | Ishtar-3fe67a45969934464e9b1ee775d63dc74005ba48.tar.bz2 Ishtar-3fe67a45969934464e9b1ee775d63dc74005ba48.zip |
Operation - Parcels - Modify: adding tests #5227
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r-- | archaeological_operations/tests.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index c2be8c050..738061ab1 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -1688,8 +1688,12 @@ class ParcelTest(ImportTest, TestCase): "form-1-section": "SCT1", "form-1-parcel_number": "002", "form-1-town": town_2, + "form-2-year": 2011, + "form-2-section": "XXX", + "form-2-parcel_number": "003", + "form-2-town": town_2, } - post_response = c.post(reverse("operation-parcels-modify", data)) + post_response = c.post("/operation-parcels-modify/" + str(operation.pk) + "/", data) self.assertEqual(post_response.status_code, 200) self.assertContains(post_response, town_2.name) @@ -1697,6 +1701,18 @@ class ParcelTest(ImportTest, TestCase): self.assertContains(post_response, "SCT1") self.assertContains(post_response, "001") self.assertContains(post_response, "002") + self.assertContains(post_response, "003") + self.assertContains(post_response, "XXX") + + data["form-0-DELETE"] = True + + post_response_deletion = c.post("/operation-parcels-modify/" + str(operation.pk) + "/", data) + + self.assertEqual(post_response_deletion.status_code, 200) + + response = c.get(reverse("operation-parcels-modify", kwargs={"pk": operation.pk})) + + self.assertContains(response, "001", count=0) def create_orga(user): |