def testPastDate(self):
        #Change end date to the past
        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], u'This coupon has expired.')
Test an expired discount
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/tests.py/DiscountTest.testPastDate