コード例 #1
0
    def test_get_products(self):
        """test get method for products"""

        sample_product_from_db = {'name': 'breakfast burrito', 'cost': 2.02, 'ingredients': 'eggs, flour tortilla, refried beans'}

        product_instance = Products()
        test = product_instance.get_products()
        self.assertEqual(test[0], sample_product_from_db)
コード例 #2
0
def products():
    product_instance = Products()
    data = product_instance.get_products()
    return render_template('products.html', products=data)