diff options
| author | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-04 19:21:10 -0700 | 
|---|---|---|
| committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-04-04 19:21:10 -0700 | 
| commit | fc443013d4a004d69c53be3286e33dd30921879e (patch) | |
| tree | 7ae87d9be5ec06d0612203f153302c496c3743d4 /python/tests/web_editor.py | |
| parent | ab649adac04086817c69113fa075f1cb9bdc6d0f (diff) | |
| download | fatcat-fc443013d4a004d69c53be3286e33dd30921879e.tar.gz fatcat-fc443013d4a004d69c53be3286e33dd30921879e.zip | |
improve test coverage
Diffstat (limited to 'python/tests/web_editor.py')
| -rw-r--r-- | python/tests/web_editor.py | 28 | 
1 files changed, 28 insertions, 0 deletions
| diff --git a/python/tests/web_editor.py b/python/tests/web_editor.py new file mode 100644 index 00000000..de094488 --- /dev/null +++ b/python/tests/web_editor.py @@ -0,0 +1,28 @@ + +import json +import pytest +from fatcat_client.rest import ApiException +from fixtures import * + + +def test_change_username(app_admin): + +    # these tests aren't supposed to mutate database +    rv = app_admin.post('/auth/change_username', data={'username': 'admin-tmp'}, +        follow_redirects=True) +    assert rv.status_code == 200 +    rv = app_admin.get('/auth/account') +    assert b'admin-tmp' in rv.data + +    rv = app_admin.post('/auth/change_username', data={'username': 'claire'}, +        follow_redirects=True) +    assert rv.status_code == 400 +    rv = app_admin.get('/auth/account') +    assert b'admin-tmp' in rv.data + +    rv = app_admin.post('/auth/change_username', data={'username': 'admin'}, +        follow_redirects=True) +    assert rv.status_code == 200 +    rv = app_admin.get('/auth/account') +    assert b'admin-tmp' not in rv.data + | 
