From d14bc3c4e190d3bdce4e03b0da18ec08793f7bce Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 23 Jul 2015 14:41:28 +0100 Subject: [PATCH] Fix test cases for python3 --- tests/test_generics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_generics.py b/tests/test_generics.py index 530354581..219a83a5d 100644 --- a/tests/test_generics.py +++ b/tests/test_generics.py @@ -153,7 +153,7 @@ class TestRootView(TestCase): request = factory.post('/', data, HTTP_ACCEPT='text/html') response = self.view(request).render() expected_error = 'Ensure this field has no more than 100 characters.' - self.assertIn(expected_error, response.rendered_content) + self.assertIn(expected_error, response.rendered_content.decode('utf-8')) EXPECTED_QUERIES_FOR_PUT = 3 if django.VERSION < (1, 6) else 2 @@ -300,7 +300,7 @@ class TestInstanceView(TestCase): request = factory.put('/', data, HTTP_ACCEPT='text/html') response = self.view(request, pk=1).render() expected_error = 'Ensure this field has no more than 100 characters.' - self.assertIn(expected_error, response.rendered_content) + self.assertIn(expected_error, response.rendered_content.decode('utf-8')) class TestFKInstanceView(TestCase):