aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2013-01-17 12:19:16 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2013-01-17 12:19:52 +0100
commit6deb589d0b2fd5adab5b74da077fb5b7390df16e (patch)
tree818fffb4ab1c56d724922cfc52c286fc74de4fb0
parent380f22b859070725a2446cef7d7b250559f1ad27 (diff)
downloadmediagoblin-6deb589d0b2fd5adab5b74da077fb5b7390df16e.tar.lz
mediagoblin-6deb589d0b2fd5adab5b74da077fb5b7390df16e.tar.xz
mediagoblin-6deb589d0b2fd5adab5b74da077fb5b7390df16e.zip
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>
-rw-r--r--mediagoblin/tests/test_edit.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py
index cbdad649..4bea9243 100644
--- a/mediagoblin/tests/test_edit.py
+++ b/mediagoblin/tests/test_edit.py
@@ -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