def get_one_drink_with_extra_ingredients(): recipes = Recipe.get_recipes_by_ingredients([self.vodka_id, self.pineapple_juice_id, self.oj_id, self.rum_id]) self.assertEqual(1, len(recipes)) self.assertEqual(self.screwdriver, recipes[0])
def get_two_drinks(): recipes = Recipe.get_recipes_by_ingredients([self.vodka_id, self.gin_id, self.oj_id]) recipes.sort(key=lambda recipe: recipe.id) expected_recipes = sorted([self.gin_vodka, self.screwdriver], key=lambda recipe: recipe.id) self.assertEqual(2, len(recipes)) self.assertListEqual(expected_recipes, recipes)
def get_drinks_with_all_ingredients(): recipes = Recipe.get_recipes_by_ingredients([self.coconut_cream_id, self.pineapple_juice_id, self.gin_id, self.oj_id, self.vodka_id, self.rum_id, self.white_rum_id]) recipes.sort(key=lambda recipe: recipe.id) expected_recipes = sorted([self.gin_vodka, self.screwdriver, self.pina_colada], key=lambda recipe: recipe.id) self.assertEqual(3, len(recipes)) self.assertListEqual(expected_recipes, recipes)
def get_one_drink(): recipes = Recipe.get_recipes_by_ingredients([self.pineapple_juice_id, self.white_rum_id, self.coconut_cream_id]) self.assertEqual(1, len(recipes)) self.assertEqual(self.pina_colada, recipes[0])