Beispiel #1
0
 def test_get_line_total_multiple_quantity(self):
     '''get_line_total returns the correct price for item with multiple
     quantity.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple', 3)
     self.assertEqual(
         cartitem.get_line_total(product_store), Decimal('0.45'))
Beispiel #2
0
 def test_get_line_total_multiple_quantity(self):
     '''get_line_total returns the correct price for item with multiple
     quantity.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple', 3)
     self.assertEqual(round(cartitem.get_line_total(product_store), 2),
                      float('0.45'))
Beispiel #3
0
 def test_nooffer_total(self):
     '''NoOffer's calculate_line_total returns same value as cart item line
     total.'''
     product_store = self._create_product_store()
     no_offer_strawberries = NoOffer('strawberries')
     cartitem = CartItem('strawberries')
     self.assertEqual(cartitem.get_line_total(
         product_store), no_offer_strawberries.calculate_line_total(cartitem, product_store))
Beispiel #4
0
 def test_nooffer_total(self):
     '''NoOffer's calculate_line_total returns same value as cart item line
     total.'''
     product_store = self._create_product_store()
     no_offer_strawberries = NoOffer('strawberries')
     cartitem = CartItem('strawberries')
     self.assertEqual(
         cartitem.get_line_total(product_store),
         no_offer_strawberries.calculate_line_total(cartitem,
                                                    product_store))
Beispiel #5
0
 def test_get_line_total(self):
     '''Cart.get_line_total() returns the correct price for product.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple')
     self.assertEqual(round(cartitem.get_line_total(product_store), 2),
                      float('0.15'))
Beispiel #6
0
 def test_get_line_total_is_float(self):
     '''Cart.get_line_total() returns a float.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple')
     self.assertTrue(
         type(round(cartitem.get_line_total(product_store), 2) is float))
Beispiel #7
0
 def test_get_line_total(self):
     '''Cart.get_line_total() returns the correct price for product.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple')
     self.assertEqual(
         cartitem.get_line_total(product_store), Decimal('0.15'))
Beispiel #8
0
 def test_get_line_total_is_decimal(self):
     '''Cart.get_line_total() returns a Decimal.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple')
     self.assertTrue(
         type(cartitem.get_line_total(product_store) is Decimal))
Beispiel #9
0
 def test_get_line_total_is_decimal(self):
     '''Cart.get_line_total() returns a Decimal.'''
     product_store = self._create_product_store()
     cartitem = CartItem('apple')
     self.assertTrue(
         type(cartitem.get_line_total(product_store) is Decimal))