Exemple #1
0
    def test_verify_but_not_added(self):                                                   # Sibling test to ensure that
        data = {                                                                           # an unwanted ingredient is
            'ingredient_names-0': 'sugar',                                                 # not added
            'ingredient_checks-0': '',
            'ingredient_names-1': 'salt',
            'ingredient_checks-1': 'y'
        }

        res = self.app.post('/verify_ingredients', data=data)

        self.assertTrue(Ingredient.exists('salt'), 'Salt not added')
        self.assertFalse(Ingredient.exists('sugar'), 'Sugar were added')
Exemple #2
0
    def test_select_verify_new_ingredient(self):                                           # Unit test that ensures the
        data = {                                                                           # items are correctly added
            'ingredient_names-0': 'chocolate chips',                                       # to user Pantry if the items
            'ingredient_checks-0': 'y',                                                    # are correct
            'ingredient_names-1': 'flour',
            'ingredient_checks-1': 'y'
        }

        res = self.app.post('/verify_ingredients', data=data)

        self.assertTrue(Ingredient.exists('chocolate chips'), 'Chocolate chips not added')
        self.assertTrue(Ingredient.exists('flour'), 'Flour not added')