From b4b146921535d8aed8ec1794f91287f7eb87be6b Mon Sep 17 00:00:00 2001 From: Marvin Steadfast Date: Wed, 31 Aug 2016 16:38:13 +0200 Subject: [PATCH] try to test login i use requests to test login. the session should be saved and this should work. but i get a error that th session expired. to run this start wallabag and run it with pytest: `py.test -s tests/`. it will output the html of the response. --- tests/test_login.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_login.py b/tests/test_login.py index 6ebeb07..1ed70e1 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -12,3 +12,15 @@ def test_login_page(): assert 'Password' in r.text assert 'Register' in r.text assert 'Username' in r.text + + +def test_login(): + with requests.Session() as s: + + data = { + '_username': 'wallabag', + '_password': 'wallabag' + } + + r = s.post(URL + '/login_check', data=data) + print(r.text)