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:
Sebastian Spaeth 2013-01-17 12:19:16 +01:00
parent 380f22b859
commit 6deb589d0b

View File

@ -37,6 +37,24 @@ class TestUserEdit(object):
'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):
"""Test changing password correctly and incorrectly"""
# test that the password can be changed