summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorCefin <kevon@tuta.io>2022-02-18 12:49:57 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:21:00 +0100
commiteb43d8ff163d347c7ac29a44a1a467a9925aba22 (patch)
treeb222aa2f5684069173781575dc21ced9585857aa /archaeological_operations/tests.py
parentc7a400871bb522de4e335932e44ee06097dd8a5f (diff)
downloadIshtar-eb43d8ff163d347c7ac29a44a1a467a9925aba22.tar.bz2
Ishtar-eb43d8ff163d347c7ac29a44a1a467a9925aba22.zip
Operation - Parcels - Modify: adapting tests for selection_form #5227
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index f35050c69..768c11d16 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -1690,8 +1690,6 @@ class ParcelTest(ImportTest, TestCase):
f"form-{idx}-DELETE": '',
})
data.update({
- "_town": town_2.pk,
- "_parcel_selection": "2013:XD:10",
"form-0-pk": parcel_1.pk,
"form-0-year": 2021,
"form-0-section": "SCT1",
@@ -1721,16 +1719,30 @@ class ParcelTest(ImportTest, TestCase):
self.assertContains(response, "002")
self.assertContains(response, "003")
self.assertContains(response, "XXX")
- self.assertContains(response, 2013)
- self.assertContains(response, "XD")
- self.assertContains(response, "10")
parcels = models.Parcel.objects.all()
- self.assertEqual(parcels.count(), 3)
+ self.assertEqual(parcels.count(), 2)
deleted_parcel = models.Parcel.objects.filter(pk=parcel_1.pk)
self.assertEqual(deleted_parcel.count(), 0)
+ data.update({
+ "_town": town_2.pk,
+ "_parcel_selection": "2013:XD:10 to 20, YD:24",
+ })
+
+ post_response = c.post("/operation-parcels-modify/" + str(operation.pk) + "/", data)
+ response = c.get(reverse("operation-parcels-modify", kwargs={"pk": operation.pk}))
+
+ self.assertContains(response, 2013)
+ self.assertContains(response, "XD")
+ self.assertContains(response, "YD")
+ self.assertContains(response, "24")
+ for i in range(10, 20):
+ self.assertContains(response, i)
+ parcels = models.Parcel.objects.all()
+ self.assertEqual(parcels.count(), 14)
+
def create_orga(user):
orga_type, created = OrganizationType.objects.get_or_create(txt_idx="operator")