def test_1_user_none(self): # Before user creation self.assertFalse(manager._is_user_created('user')) self.assertFalse(manager.get_password('user')) self.assertIsNone(manager.get_user('user')) self.assertFalse(manager.change_password('user', 'some_pass')) self.assertFalse(manager.change_email('user', 'some_email')) self.assertFalse(manager.delete_user('user')) self.assertIsNone(manager.get_user_tags('user')) self.assertFalse(manager.add_favourite('user', '3')) self.assertFalse(manager.delete_favourite('user', '3')) self.assertIsNone(manager.get_favourites('user')) self.assertEqual(-1, manager.get_favourite_count('user')) self.assertIsNone(manager.get_post('8')) self.assertFalse(manager.delete_post('8', 'user')) self.assertIsNone(manager.get_posts('user'))
def delete(self, username): #OK """ Hanldes DELETE requests to delete an existing user.""" debug("DELETE USER:"******"User deleted.", code=200)
def test_6_deleting(self): manager.populate_test2() self.assertTrue(manager.delete_post('1', 'seven')) self.assertFalse(manager._is_post_created('1')) self.assertTrue(manager.delete_user('seven')) self.assertIsNone(manager.get_posts('seven'))