From e51452653daa8ec269270c0f1a498e3e6cdeafb9 Mon Sep 17 00:00:00 2001 From: Rob van der Linde Date: Fri, 8 Mar 2024 14:02:11 +1300 Subject: [PATCH] tests: login tests also does logout --- tests/test_login.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_login.py b/tests/test_login.py index 9e8a1ca..0936486 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -20,7 +20,7 @@ def handle_starttag(self, tag, attrs): self.return_url = tag_attrs["value"] -def test_login(testapp, settings): +def test_login_logout(testapp, settings): response = testapp.get("/login/", status=200) parser = LoginHTMLParser() parser.feed(response.text) @@ -40,6 +40,10 @@ def test_login(testapp, settings): response = testapp.get("/", status=200) assert "Sambal Login" not in response.text + testapp.get("/logout/", status=302) + response = testapp.get("/", status=200) + assert "Sambal Login" in response.text + def test_login_required(testapp): response = testapp.get("/", status=200)