From 6deb589d0b2fd5adab5b74da077fb5b7390df16e Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 17 Jan 2013 12:19:16 +0100 Subject: [PATCH] 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 --- mediagoblin/tests/test_edit.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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