|
|
@@ -5,16 +5,16 @@ from django.test import TestCase
|
|
5
|
5
|
from oscar.apps.voucher.models import Voucher
|
|
6
|
6
|
|
|
7
|
7
|
|
|
8
|
|
-class VoucherTest(TestCase):
|
|
|
8
|
+class TestVoucher(TestCase):
|
|
9
|
9
|
|
|
10
|
|
- def test_is_active(self):
|
|
|
10
|
+ def test_is_active_between_start_and_end_dates(self):
|
|
11
|
11
|
start = datetime.date(2011, 01, 01)
|
|
12
|
12
|
test = datetime.date(2011, 01, 10)
|
|
13
|
13
|
end = datetime.date(2011, 02, 01)
|
|
14
|
14
|
voucher = Voucher(start_date=start, end_date=end)
|
|
15
|
15
|
self.assertTrue(voucher.is_active(test))
|
|
16
|
16
|
|
|
17
|
|
- def test_is_inactive(self):
|
|
|
17
|
+ def test_is_inactive_outside_of_start_and_end_dates(self):
|
|
18
|
18
|
start = datetime.date(2011, 01, 01)
|
|
19
|
19
|
test = datetime.date(2011, 03, 10)
|
|
20
|
20
|
end = datetime.date(2011, 02, 01)
|
|
|
@@ -27,7 +27,3 @@ class VoucherTest(TestCase):
|
|
27
|
27
|
voucher = Voucher(name="Dummy voucher", code="lowercase", start_date=start, end_date=end)
|
|
28
|
28
|
voucher.save()
|
|
29
|
29
|
self.assertEquals("LOWERCASE", voucher.code)
|
|
30
|
|
-
|
|
31
|
|
-
|
|
32
|
|
-
|
|
33
|
|
-
|