Introduce user_deletion test.
Delete a user via web interface and see if it works. TODO: this does not test that related entries are also cleaned up and we should extend the test to do so. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
380f22b859
commit
6deb589d0b
@ -37,6 +37,24 @@ class TestUserEdit(object):
|
|||||||
'password': self.user_password})
|
'password': self.user_password})
|
||||||
|
|
||||||
|
|
||||||
|
def test_user_deletion(self):
|
||||||
|
"""Delete user via web interface"""
|
||||||
|
# Make sure user exists
|
||||||
|
assert User.query.filter_by(username=u'chris').first()
|
||||||
|
|
||||||
|
res = self.app.post('/edit/account/delete/', {'confirmed': 'y'})
|
||||||
|
|
||||||
|
# Make sure user has been deleted
|
||||||
|
assert User.query.filter_by(username=u'chris').first() == None
|
||||||
|
|
||||||
|
#TODO: make sure all corresponding items comments etc have been
|
||||||
|
# deleted too. Perhaps in submission test?
|
||||||
|
|
||||||
|
#Restore user at end of test
|
||||||
|
self.user = fixture_add_user(password = self.user_password)
|
||||||
|
self.login()
|
||||||
|
|
||||||
|
|
||||||
def test_change_password(self):
|
def test_change_password(self):
|
||||||
"""Test changing password correctly and incorrectly"""
|
"""Test changing password correctly and incorrectly"""
|
||||||
# test that the password can be changed
|
# test that the password can be changed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user