Ograniczenie testów do właściwych pakietów: wiki, vstorage, toolbar.
authorŁukasz Rekucki <lrekucki@gmail.com>
Fri, 26 Feb 2010 00:36:50 +0000 (01:36 +0100)
committerŁukasz Rekucki <lrekucki@gmail.com>
Fri, 26 Feb 2010 00:36:50 +0000 (01:36 +0100)
apps/wiki/tests.py
platforma/settings.py [changed mode: 0755->0644]

index 4262d20..91eccc8 100644 (file)
@@ -1,12 +1,20 @@
-import unittest
+from nose.tools import *
 import wiki.models as models
+import shutil, tempfile
 
-class TestDocument(unittest.TestCase):
-
+class TestStorageBase:
     def setUp(self):
-        models.storage = None
+        self.dirpath = tempfile.mkdtemp(prefix = 'nosetest_')
+
+    def tearDown(self):
+        shutil.rmtree(self.dirpath)
+
+class TestDocumentStorage(TestStorageBase):
+
+    def test_storage_empty(self):
+        storage = models.DocumentStorage(self.dirpath)
+        eq_(storage.all(), [])
 
-    def
 
 
 
old mode 100755 (executable)
new mode 100644 (file)
index 6a1a12e..2c4e658
@@ -107,6 +107,7 @@ TEMPLATE_DIRS = (
 # 
 # COMPRESS_CSS_FILTERS = None
 
+
 INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
@@ -124,6 +125,14 @@ INSTALLED_APPS = (
 )
 
 TEST_RUNNER = 'django_nose.run_tests'
+TEST_MODULES = ('wiki', 'toolbar', 'vstorage')
+NOSE_ARGS = (
+    '--tests=' + ','.join(TEST_MODULES),
+    '--cover-package=' + ','.join(TEST_MODULES),
+    '-d',
+    '--with-coverage',
+    '--with-doctest'
+)
 
 
 FILEBROWSER_URL_FILEBROWSER_MEDIA = STATIC_URL + 'filebrowser/'