1
0
mirror of https://github.com/wallabag/docker synced 2025-12-13 17:56:31 +00:00
Files
docker-wallabag/tests/test_login.py
Marvin Steadfast b4b1469215 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.
2016-08-31 16:38:13 +02:00

27 lines
507 B
Python

import requests
URL = 'http://127.0.0.1:80'
def test_login_page():
r = requests.get(URL, allow_redirects=True)
assert r.status_code == 200
assert 'Login' in r.text
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)