summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 738061ab1..a4ac40376 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -1680,18 +1680,20 @@ class ParcelTest(ImportTest, TestCase):
self.assertContains(response, parcel_2.parcel_number)
data = {
+ "form-0-pk": parcel_1.pk,
"form-0-year": 2021,
"form-0-section": "SCT1",
"form-0-parcel_number": "001",
- "form-0-town": town_2,
+ "form-0-town": town_2.pk,
+ "form-1-pk": parcel_2.pk,
"form-1-year": 2021,
"form-1-section": "SCT1",
"form-1-parcel_number": "002",
- "form-1-town": town_2,
+ "form-1-town": town_2.pk,
"form-2-year": 2011,
"form-2-section": "XXX",
"form-2-parcel_number": "003",
- "form-2-town": town_2,
+ "form-2-town": town_2.pk,
}
post_response = c.post("/operation-parcels-modify/" + str(operation.pk) + "/", data)
@@ -1704,6 +1706,9 @@ class ParcelTest(ImportTest, TestCase):
self.assertContains(post_response, "003")
self.assertContains(post_response, "XXX")
+ # parcels = models.Parcel.objects.all()
+ # self.assertEqual(parcels.count(), 3)
+
data["form-0-DELETE"] = True
post_response_deletion = c.post("/operation-parcels-modify/" + str(operation.pk) + "/", data)
@@ -1713,7 +1718,9 @@ class ParcelTest(ImportTest, TestCase):
response = c.get(reverse("operation-parcels-modify", kwargs={"pk": operation.pk}))
self.assertContains(response, "001", count=0)
-
+ deleted_parcel = models.Parcel.objects.filter(pk=parcel_1.pk)
+ print(deleted_parcel)
+ self.assertEqual(deleted_parcel.count(), 0)
def create_orga(user):
orga_type, created = OrganizationType.objects.get_or_create(txt_idx="operator")