mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 21:40:13 +03:00
added content decode
This commit is contained in:
parent
fa5c867f0d
commit
dac21ab7dc
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user