def test_get_user_recipes(self): """ Test to ensure we can get users' recipes """ username = "******" self.assertIn(app.get_recipe('5b91483146073f953359fce8'), list(app.get_user_recipes(username)))
def test_remove_user_recipe(self): """ Test to ensure we can remove a recipe id from a user's list of recipes """ username = "******" user_id = "5b648d93fb6fc072a40f6d8f" recipe_id = "5b8fc23a59d1979fc3608b0a" app.remove_user_recipe_from_list(user_id, 'my_recipes', recipe_id) self.assertNotIn(recipe_id, list(app.get_user_recipes(username))) # re-add recipe after test app.add_user_recipe_to_list(user_id, 'my_recipes', recipe_id)
def test_add_user_recipe(self): """ Test to ensure we can add a recipe id to a user's list of recipes """ username = "******" user_id = "5b648d93fb6fc072a40f6d8f" recipe_id = "5b8fc23a59d1979fc3608b0a" # remove recipe before test app.remove_user_recipe_from_list(user_id, 'my_recipes', recipe_id) app.add_user_recipe_to_list(user_id, 'my_recipes', recipe_id) self.assertIn(app.get_recipe(recipe_id), list(app.get_user_recipes(username)))