def test_version_list(self): recipe = new_recipe(sunny_side_up['title'], sunny_side_up['description'], 22, sunny_side_up['ingredients'], sunny_side_up['steps']) updated_recipe = update_recipe(recipe['id'], sunny_side_up_v2['ingredients'], sunny_side_up_v2['steps'], message=sunny_side_up_v2['message']) self.assertEqual(len(get_versions(recipe['id'])), 2) version_ids = [x[0] for x in get_versions(recipe['id'])] updated_version_ids = [x[0] for x in get_versions(updated_recipe['id'])] self.assertIn(recipe['data']['id'], version_ids) self.assertIn(recipe['data']['id'], updated_version_ids)
def test_recipe_version(self): recipe = new_recipe(sunny_side_up['title'], sunny_side_up['description'], 22, sunny_side_up['ingredients'], sunny_side_up['steps']) updated_recipe = update_recipe(recipe['id'], sunny_side_up_v2['ingredients'], sunny_side_up_v2['steps']) old_version = get_recipe_version(updated_recipe['id'], recipe['data']['id']) self.assertNotIn("cheese", old_version['data']['ingredients'])
def test_update_recipe(self): recipe = new_recipe(sunny_side_up['title'], sunny_side_up['description'], 22, sunny_side_up['ingredients'], sunny_side_up['steps']) updated_recipe = update_recipe(recipe['id'], sunny_side_up_v2['ingredients'], sunny_side_up_v2['steps']) self.assertNotEqual(recipe['data']['id'], updated_recipe['data']['id'])