Fixed the test for the new Unauthorized exception.

This commit is contained in:
François KUBLER 2017-06-23 17:16:31 +02:00
parent 9fcdacb624
commit 60aa60f48e

View File

@ -119,11 +119,12 @@ def test_unauthorized_exception(exception_app):
assert response.status == 401 assert response.status == 401
auth_header = response.headers.get('WWW-Authenticate') auth_header = response.headers.get('WWW-Authenticate')
expected = ("Digest realm='Sanic', qop='auth, auth-int', algorithm='MD5', "
"nonce='abcdef', opaque='zyxwvu'")
assert auth_header is not None assert auth_header is not None
assert auth_header == expected assert auth_header.startswith('Digest')
assert "qop='auth, auth-int'" in auth_header
assert "algorithm='MD5'" in auth_header
assert "nonce='abcdef'" in auth_header
assert "opaque='zyxwvu'" in auth_header
def test_handled_unhandled_exception(exception_app): def test_handled_unhandled_exception(exception_app):