def test_edit_shopping_list(self): """This method tests if the application edits shopping lists correctly""" with self.tester as the_tester: the_tester.post("/login", data=dict(username="******", password="******"), follow_redirects=True) the_tester.post("/create_shopping_list", data=dict(title="List 1"), follow_redirects=True) the_tester.post("/edit_shopping_list", data=dict(old_title="List 1", new_title="New List"), follow_redirects=True) self.assertIn( "New List", the_application.get_all_lists("homie").keys(), msg="There should be a list named `List 1` in the user lists") self.assertNotIn( "List 1", the_application.get_all_lists("homie").keys(), msg="There should be a list named `List 1` in the user lists")
def test_create_shopping_list(self): """This method tests if the application creates shopping lists correctly""" with self.tester as the_tester: the_tester.post("/login", data=dict(username="******", password="******"), follow_redirects=True) the_tester.post("/create_shopping_list", data=dict(title="List 1"), follow_redirects=True) self.assertIn( "List 1", the_application.get_all_lists("ivo").keys(), msg="There should be a list named `List 1` in the user lists")