Skip to content

Commit

Permalink
Adding test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ssadhu-sl committed Sep 30, 2024
1 parent c8da2dd commit e7cc80b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/integration/test_entity_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,4 +538,23 @@ def test_search_entity_by_organisation_curie(test_data, params, db_session):
assert entity.reference == expected_entity["reference"]


def test_search_entity_with_exclude_parameter(test_data, params, db_session):
from tests.test_data.wkt_data import intersects_with_brownfield_entity as brownfield
from tests.test_data.wkt_data import intersects_with_greenspace_entity as greenspace

params["geometry"] = [brownfield, greenspace]
params["geometry_relation"] = GeometryRelation.intersects.name
params["exclude_field"] = [""]
result = get_entity_search(db_session, params)
for entity in result["entities"]:
assert entity.geometry is not None
assert result["count"] == 2

params["exclude_field"] = ["geometry"]
result = get_entity_search(db_session, params)
for entity in result["entities"]:
assert entity.geometry is None
assert result["count"] == 2


# TODO test cases for contains, within

0 comments on commit e7cc80b

Please sign in to comment.