From fcbcb2ba128ad7a68cb54bcd7302fd74aade4e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=9Fuayip=20=C3=BCz=C3=BClmez?= Date: Mon, 19 Feb 2024 20:03:18 +0300 Subject: [PATCH] Add a test that checks the presence of the logout form --- tests/browsable_api/test_browsable_api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/browsable_api/test_browsable_api.py b/tests/browsable_api/test_browsable_api.py index a76d11fe3..758e3d1a4 100644 --- a/tests/browsable_api/test_browsable_api.py +++ b/tests/browsable_api/test_browsable_api.py @@ -65,6 +65,12 @@ class DropdownWithAuthTests(TestCase): content = response.content.decode() 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 '
' in content + @override_settings(ROOT_URLCONF='tests.browsable_api.no_auth_urls') class NoDropdownWithoutAuthTests(TestCase):