diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py index 560e5e10ab..0201e28bf8 100644 --- a/tests/urlpatterns_reverse/tests.py +++ b/tests/urlpatterns_reverse/tests.py @@ -396,7 +396,7 @@ class ResolverTests(SimpleTestCase): [{'type': RegexURLResolver}, {'type': RegexURLPattern, 'name': None}], [{'type': RegexURLResolver}, {'type': RegexURLResolver}], ] - with self.assertRaisesMessage(Resolver404, "tried") as cm: + with self.assertRaisesMessage(Resolver404, b'tried' if six.PY2 else 'tried') as cm: resolve('/included/non-existent-url', urlconf=urls) e = cm.exception # make sure we at least matched the root ('/') url resolver: