

def testPastDate(self):
    'Test an expired discount'
    start = datetime.date(2000, 1, 1)
    end = datetime.date(2006, 1, 1)
    self.discount.startDate = start
    self.discount.endDate = end
    self.discount.save()
    v = self.discount.isValid()
    self.assertFalse(v[0])
    self.assertEqual(v[1], 'This coupon has expired.')

dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/tests.py DiscountTest.testPastDate/original