

def test_discount_qty_price(self):
    'Test quantity price discounts'
    product = Product.objects.get(slug='PY-Rocks')
    price = Price(product=product, quantity=Decimal('10'), price=Decimal('10.00'))
    price.save()
    self.assertEqual(product.unit_price, Decimal('19.50'))
    self.assertEqual(product.get_qty_price(Decimal('1')), Decimal('19.50'))
    self.assertEqual(product.get_qty_price(Decimal('2')), Decimal('19.50'))
    self.assertEqual(product.get_qty_price(Decimal('10')), Decimal('10.00'))

dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/tests.py ProductTest.test_discount_qty_price/original