Procházet zdrojové kódy

Added new test deps to requirements file.

Plus tweaks to test method names
master
David Winterbottom před 13 roky
rodič
revize
afabcf32bb
4 změnil soubory, kde provedl 6 přidání a 10 odebrání
  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 Zobrazit soubor

@@ -13,4 +13,5 @@ twill==0.9
13 13
 PyHamcrest==1.6
14 14
 South==0.7.3
15 15
 purl==0.3.2
16
-django-sorting==0.1
16
+pinocchio==0.3.1
17
+nose-progressive==1.3

+ 0
- 1
runtests.py Zobrazit soubor

@@ -39,5 +39,4 @@ if __name__ == '__main__':
39 39
         print 'Generate HTML reports'
40 40
         c.html_report()
41 41
     else:
42
-        print 'Running tests'
43 42
         run_tests(options.verbosity, *args)

+ 1
- 1
tests/config.py Zobrazit soubor

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

+ 3
- 7
tests/unit/voucher_tests.py Zobrazit soubor

@@ -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
-   

Načítá se…
Zrušit
Uložit