Skip to content

Commit

Permalink
Fix new test
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Aug 10, 2021
1 parent 34772b7 commit 6db2727
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/models/test_jsonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ def test_response_top_level():
assert isinstance(Response(data=None), Response)
assert isinstance(Response(meta={}), Response)
assert isinstance(Response(meta=None), Response)
assert isinstance(Response(errors=[]), Response)
assert isinstance(Response(errors=None), Response)

with pytest.raises(ValidationError):
# "errors" MUST NOT be an empty or `null` value if given.
with pytest.raises(ValidationError, match=r"Errors MUST NOT be an empty.*"):
assert isinstance(Response(errors=[]), Response)
with pytest.raises(ValidationError, match=r"Errors MUST NOT be an empty.*"):
assert isinstance(Response(errors=None), Response)

with pytest.raises(ValidationError, match=r"At least one of .*"):
Response(links={})

0 comments on commit 6db2727

Please sign in to comment.