From 60aa60f48ea2536ac95ad61276dfa4ab64195a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Fri, 23 Jun 2017 17:16:31 +0200 Subject: [PATCH] Fixed the test for the new Unauthorized exception. --- tests/test_exceptions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 4330ef57..dcdecabd 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -119,11 +119,12 @@ def test_unauthorized_exception(exception_app): assert response.status == 401 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 == 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):