* adds workflow testing for geometries on new creation of intervention and compensation
*
This commit is contained in:
2021-11-12 14:54:33 +01:00
parent 6c35fc59af
commit 92cfb95789
4 changed files with 101 additions and 6 deletions

View File

@@ -39,7 +39,9 @@ class InterventionWorkflowTestCase(BaseWorkflowTestCase):
"""
# Define the intervention identifier for easier handling on the next lines
test_id = "Test_IDENTIFIER"
test_id = self.create_dummy_string()
test_title = self.create_dummy_string()
test_geom = self.create_dummy_geometry()
new_url = reverse("intervention:new", args=())
@@ -52,8 +54,8 @@ class InterventionWorkflowTestCase(BaseWorkflowTestCase):
# User creates a new intervention with bare minimum content, using the proper url and post data
post_data = {
"identifier": test_id,
"title": "Test_TITLE",
"geometry": "",
"title": test_title,
"geom": test_geom.geojson,
}
response = self.client_user.post(
new_url,
@@ -66,6 +68,8 @@ class InterventionWorkflowTestCase(BaseWorkflowTestCase):
identifier=test_id
)
self.assertEqual(obj.identifier, test_id)
self.assertEqual(obj.title, test_title)
self.assert_equal_geometries(obj.geometry.geom, test_geom)
except ObjectDoesNotExist:
# Fail if there is no such object
self.fail()
@@ -210,7 +214,7 @@ class InterventionWorkflowTestCase(BaseWorkflowTestCase):
# Create form data to be sent to the url
test_amount = 10.00
test_due = "2021-01-01"
test_comment = "test_comment"
test_comment = self.create_dummy_string()
post_data = {
"amount": test_amount,
"due": test_due,