def testRetrieveAutoDiscounts(self): products = [i.product for i in self.order.orderitem_set.all()] discounts = find_auto_discounts(products) self.assertEqual(set([d.code for d in discounts]), set(['test20-auto', 'test20-auto-all'])) self.assertEqual([d.percentage for d in discounts], [Decimal('20.0'), Decimal('20.0')])
def testRetrieveAutoDiscounts(self): products = [i.product for i in self.order.orderitem_set.all()] discounts = find_auto_discounts(products) self.assertEqual( set([d.code for d in discounts]), set(['test20-auto', 'test20-auto-all'])) self.assertEqual( [d.percentage for d in discounts], [Decimal('20.0'), Decimal('20.0')])