mirror of
https://github.com/wallabag/docker
synced 2025-12-13 17:56:31 +00:00
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.
This commit is contained in:
@@ -12,3 +12,15 @@ def test_login_page():
|
|||||||
assert 'Password' in r.text
|
assert 'Password' in r.text
|
||||||
assert 'Register' in r.text
|
assert 'Register' in r.text
|
||||||
assert 'Username' 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user