Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,13 @@ def test_votings_create(db):
assert response.data["dumpster"] == dumpster.id
assert response.data["comment"] == "Hallo123"
assert response.data["value"] == "good"


def test_dumpsters_count_within_bounds(db):
dumpster1 = DumpsterFactory(location="POINT(1 1)")
dumpster2 = DumpsterFactory(location="POINT(0.2 0.2)")

response = APIClient().get("/dumpsters/countwithinbounds/0.5/0.5/1.5/1.5/")

assert response.status_code == status.HTTP_200_OK
assert response.data["count"] == 1