Skip to content

Commit 8d151da

Browse files
Add test case for user login POST request
1 parent ff9762c commit 8d151da

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/moin/apps/frontend/_tests/test_frontend.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ def test_recoverpass(self):
330330
def test_login(self):
331331
self._test_view("frontend.login")
332332

333+
def test_login_post(self):
334+
username = "moin"
335+
password = "Xiwejr622"
336+
create_user(username, password)
337+
response = self._test_view_post(
338+
"frontend.login",
339+
form={
340+
"login_username": username,
341+
"login_password": password,
342+
"login_nexturl": "http://localhost/Home",
343+
"login_submit": "1",
344+
},
345+
data=("Redirecting...",),
346+
)
347+
assert response.location == "http://localhost/Home"
348+
333349
def test_logout(self):
334350
self._test_view("frontend.logout", status="302 FOUND", data=["<!doctype html"])
335351

0 commit comments

Comments
 (0)