Skip to content

Commit

Permalink
test empty query succeeds when auth is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssadai committed Jul 17, 2024
1 parent 9f939a8 commit d52e919
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,3 +495,17 @@ def test_aggregate_query_response_structure(
assert all(
dataset["subject_data"] == "protected" for dataset in response.json()
)


def test_query_without_token_succeeds_when_auth_disabled(
test_app,
mock_successful_get,
monkeypatch,
disable_auth,
):
"""
Test that when authentication is disabled, a request to the /query route without a token succeeds.
"""
monkeypatch.setattr(crud, "get", mock_successful_get)
response = test_app.get("/query/")
assert response.status_code == 200

0 comments on commit d52e919

Please sign in to comment.