Skip to content

Commit

Permalink
add test for geometry less layer
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 17, 2024
1 parent 053da79 commit 5bd1c21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/django_oapif_tests/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,15 @@ def test_post_without_geometry(self):
url = f"{collections_url}/{layer}/items"
post_to_items = self.client.post(url, data, format="json")
self.assertIn(post_to_items.status_code, (200, 201), (url, data, post_to_items.data))

def test_post_geometry_less_layer(self):
self.client.force_authenticate(user=self.demo_editor)
data = {
"geometry": None,
"properties": {"field_str_0": "test123456"},
}

for layer in ("tests.nogeom_10fields",):
url = f"{collections_url}/{layer}/items"
post_to_items = self.client.post(url, data, format="json")
self.assertIn(post_to_items.status_code, (200, 201), (url, data, post_to_items.data))

0 comments on commit 5bd1c21

Please sign in to comment.