Przeglądaj źródła

Added new test deps to requirements file.

Plus tweaks to test method names
master
David Winterbottom 13 lat temu
rodzic
commit
afabcf32bb
4 zmienionych plików z 6 dodań i 10 usunięć
  1. 2
    1
      requirements.txt
  2. 0
    1
      runtests.py
  3. 1
    1
      tests/config.py
  4. 3
    7
      tests/unit/voucher_tests.py

+ 2
- 1
requirements.txt Wyświetl plik

13
 PyHamcrest==1.6
13
 PyHamcrest==1.6
14
 South==0.7.3
14
 South==0.7.3
15
 purl==0.3.2
15
 purl==0.3.2
16
-django-sorting==0.1
16
+pinocchio==0.3.1
17
+nose-progressive==1.3

+ 0
- 1
runtests.py Wyświetl plik

39
         print 'Generate HTML reports'
39
         print 'Generate HTML reports'
40
         c.html_report()
40
         c.html_report()
41
     else:
41
     else:
42
-        print 'Running tests'
43
         run_tests(options.verbosity, *args)
42
         run_tests(options.verbosity, *args)

+ 1
- 1
tests/config.py Wyświetl plik

55
             HAYSTACK_SEARCH_ENGINE='dummy',
55
             HAYSTACK_SEARCH_ENGINE='dummy',
56
             HAYSTACK_SITECONF = 'oscar.search_sites',
56
             HAYSTACK_SITECONF = 'oscar.search_sites',
57
             APPEND_SLASH=True,
57
             APPEND_SLASH=True,
58
-            NOSE_ARGS=['-s', '-x'],
58
+            NOSE_ARGS=['-s', '-x', '--with-spec'],
59
             **OSCAR_SETTINGS
59
             **OSCAR_SETTINGS
60
         )
60
         )

+ 3
- 7
tests/unit/voucher_tests.py Wyświetl plik

5
 from oscar.apps.voucher.models import Voucher
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
         start = datetime.date(2011, 01, 01)
11
         start = datetime.date(2011, 01, 01)
12
         test = datetime.date(2011, 01, 10)
12
         test = datetime.date(2011, 01, 10)
13
         end = datetime.date(2011, 02, 01)
13
         end = datetime.date(2011, 02, 01)
14
         voucher = Voucher(start_date=start, end_date=end)
14
         voucher = Voucher(start_date=start, end_date=end)
15
         self.assertTrue(voucher.is_active(test))
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
         start = datetime.date(2011, 01, 01)
18
         start = datetime.date(2011, 01, 01)
19
         test = datetime.date(2011, 03, 10)
19
         test = datetime.date(2011, 03, 10)
20
         end = datetime.date(2011, 02, 01)
20
         end = datetime.date(2011, 02, 01)
27
         voucher = Voucher(name="Dummy voucher", code="lowercase", start_date=start, end_date=end)
27
         voucher = Voucher(name="Dummy voucher", code="lowercase", start_date=start, end_date=end)
28
         voucher.save()
28
         voucher.save()
29
         self.assertEquals("LOWERCASE", voucher.code)
29
         self.assertEquals("LOWERCASE", voucher.code)
30
-        
31
-
32
-    
33
-   

Ładowanie…
Anuluj
Zapisz