Skip to content

Commit

Permalink
Add test for checking invalid uuids in related/
Browse files Browse the repository at this point in the history
  • Loading branch information
Krystle Salazar committed Dec 12, 2024
1 parent d15b0cb commit 514c8d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/test/integration/test_media_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def test_search_refuses_invalid_categories(
@pytest.mark.parametrize(
"bad_uuid",
[
"000000000000000000000000000000000000",
"123456789123456789123456789123456789",
"12345678-1234-5678-1234-1234567891234",
"abcd",
Expand Down Expand Up @@ -383,6 +384,22 @@ def test_detail_view_contains_sensitivity_info(sensitive_result, api_client):
################


@pytest.mark.parametrize(
"bad_uuid",
[
"000000000000000000000000000000000000",
"123456789123456789123456789123456789",
"12345678-1234-5678-1234-1234567891234",
"abcd",
],
)
def test_related_view_for_invalid_uuids_returns_not_found(
media_type_config: MediaTypeConfig, bad_uuid: str, api_client
):
res = api_client.get(f"/v1/{media_type_config.url_prefix}/{bad_uuid}/related/")
assert res.status_code == 404


def test_related_view_has_no_pagination(related_results):
_, _, data = related_results
results = data["results"]
Expand Down

0 comments on commit 514c8d1

Please sign in to comment.