Skip to content
Snippets Groups Projects
Unverified Commit b826b694 authored by jan.bednarik's avatar jan.bednarik Committed by GitHub
Browse files

Merge pull request #10 from wotaen/master

response.content no longer breaks if bytes is returned
parents ebb4afc1 2d5d5265
No related branches found
No related tags found
No related merge requests found
......@@ -5,3 +5,4 @@ __pycache__/
*.egg-info/
.coverage
.pytest_cache/
.idea
\ No newline at end of file
......@@ -48,7 +48,8 @@ def test_wrong_header(snapshot):
request.META.get.assert_called_once_with('HTTP_AUTHORIZATION')
assert response.status_code == 400
snapshot.assert_match(json.loads(response.content))
as_str = response.content.decode() if hasattr(response.content, 'decode') else response.content
snapshot.assert_match(json.loads(as_str))
def test_invalid_token(snapshot):
......@@ -61,7 +62,8 @@ def test_invalid_token(snapshot):
request.META.get.assert_called_once_with('HTTP_AUTHORIZATION')
assert response.status_code == 401
snapshot.assert_match(json.loads(response.content))
as_str = response.content.decode() if hasattr(response.content,'decode') else response.content
snapshot.assert_match(json.loads(as_str))
def test_unknown_user(snapshot):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment