def tearDown(self): m = meeplib.get_all_messages()[0] meeplib.delete_message(m) u = meeplib.get_all_users()[0] meeplib.delete_user(u) assert len(meeplib._messages) == 0 assert len(meeplib._users) == 0 assert len(meeplib._user_ids) == 0
def tearDown(self): m = meeplib.get_message(self.msgId) if m != None: meeplib.delete_message(m) l = len(meeplib.get_all_users()) meeplib.delete_user(meeplib.get_user(self.ux)) lafter = len(meeplib.get_all_users()) assert l > lafter
def tearDown(self): m = meeplib.get_all_threads() z = m[0].get_all_posts('id') m[0].delete_post(z[0]) u = meeplib.get_all_users()[0] meeplib.delete_user(u) assert len(meeplib._messages) == 0 assert len(meeplib._users) == 0 assert len(meeplib._user_ids) == 0
def test_delete_user(self): #check that there is 1 user assert len(meeplib.get_all_users()) == 1 assert len(meeplib._user_ids) == 1 for msg in meeplib._messages.values(): meeplib.delete_message(msg) meeplib.delete_user(meeplib.get_user('foo')) #check that there are no users assert len(meeplib.get_all_users()) == 0 assert len(meeplib._user_ids) == 0
def delete_loggedin_user_action(self, environ, start_response): headers = [('Content-type', 'text/html')] u = self.getUser(environ) if u.username is None: start_response("200 OK", headers) return ["You must be logged in to delete your user. <p><a href='/login'>Log in</a><p><a href='/'>Show messages</a>"] meeplib.delete_user(u) self.log_user_out(environ, headers) headers = [('Content-type', 'text/html')] start_response("200 OK", headers) return ["You have successfully deleted this user."]
def test_tearDown(self): print "test teardown" users = meeplib.get_all_users() for user in users: meeplib.delete_user(user) print meeplib._user_ids messages = meeplib.get_all_messages() for m in messages: meeplib.delete_message(m) print len(meeplib._user_ids) assert len(meeplib._messages) == 0 assert len(meeplib._users) == 0 assert len(meeplib._user_ids) == 0 meeplib._reset()
def tearDown(self): t = meeplib.get_all_threads()[0] m = t.get_all_posts()[0] t.delete_post(m) u = meeplib.get_all_users()[0] v = meeplib.get_all_users()[1] meeplib.delete_user(u) meeplib.delete_user(v) assert len(meeplib._threads) == 0 assert len(meeplib._users) == 0 assert len(meeplib._user_ids) == 0
def delete_loggedin_user_action(self, environ, start_response): headers = [('Content-type', 'text/html')] u = self.getUser(environ) if u.username is None: start_response("200 OK", headers) return [ "You must be logged in to delete your user. <p><a href='/login'>Log in</a><p><a href='/'>Show messages</a>" ] meeplib.delete_user(u) self.log_user_out(environ, headers) headers = [('Content-type', 'text/html')] start_response("200 OK", headers) return ["You have successfully deleted this user."]
def tearDown(self): u = meeplib.get_all_users()[0] meeplib.delete_user(u) assert len(meeplib._users) == 0 assert len(meeplib._user_ids) == 0