todolists: tests: convert response.content to str

Network data is usually a bytes object while the todolist.name is a str.
This commit is contained in:
Jelle van der Waa 2018-04-22 20:31:17 +02:00
parent f56caf45c0
commit 79ae9db6f3

View File

@ -21,12 +21,12 @@ def setUp(self):
def test_todolist_overview(self):
response = self.client.get('/todo/')
self.assertEqual(response.status_code, 200)
self.assertIn(self.todolist.name, response.content)
self.assertIn(self.todolist.name, response.content.decode())
def test_todolist_detail(self):
response = self.client.get(self.todolist.get_absolute_url())
self.assertEqual(response.status_code, 200)
self.assertIn(self.todolist.name, response.content)
self.assertIn(self.todolist.name, response.content.decode())
def test_todolist_json(self):
response = self.client.get(self.todolist.get_absolute_url() + 'json')