mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-16 19:22:24 +03:00
Add a test that checks the presence of the logout form
This commit is contained in:
parent
edeabb1546
commit
fcbcb2ba12
|
@ -65,6 +65,12 @@ class DropdownWithAuthTests(TestCase):
|
||||||
content = response.content.decode()
|
content = response.content.decode()
|
||||||
assert '>Log in<' in content
|
assert '>Log in<' in content
|
||||||
|
|
||||||
|
def test_dropdown_contains_logout_form(self):
|
||||||
|
self.client.login(username=self.username, password=self.password)
|
||||||
|
response = self.client.get('/')
|
||||||
|
content = response.content.decode()
|
||||||
|
assert '<form id="logoutForm" method="post" action="/auth/logout/?next=/">' in content
|
||||||
|
|
||||||
|
|
||||||
@override_settings(ROOT_URLCONF='tests.browsable_api.no_auth_urls')
|
@override_settings(ROOT_URLCONF='tests.browsable_api.no_auth_urls')
|
||||||
class NoDropdownWithoutAuthTests(TestCase):
|
class NoDropdownWithoutAuthTests(TestCase):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user