added content decode

This commit is contained in:
Asif Saifuddin Auvi 2016-11-30 22:48:30 +06:00
parent fa5c867f0d
commit dac21ab7dc

View File

@ -58,13 +58,16 @@ class NoDropdownWithoutAuthTests(TestCase):
def test_name_shown_when_logged_in(self): def test_name_shown_when_logged_in(self):
self.client.login(username=self.username, password=self.password) self.client.login(username=self.username, password=self.password)
response = self.client.get('/') response = self.client.get('/')
assert 'john' in response content = response.content.decode('utf8')
assert 'john' in content
def test_dropdown_not_shown_when_logged_in(self): def test_dropdown_not_shown_when_logged_in(self):
self.client.login(username=self.username, password=self.password) self.client.login(username=self.username, password=self.password)
response = self.client.get('/') response = self.client.get('/')
assert '<li class="dropdown">' not in response content = response.content.decode('utf8')
assert '<li class="dropdown">' not in content
def test_dropdown_not_shown_when_logged_out(self): def test_dropdown_not_shown_when_logged_out(self):
response = self.client.get('/') response = self.client.get('/')
assert '<li class="dropdown">' not in response content = response.content.decode('utf8')
assert '<li class="dropdown">' not in content