From beb9f10bd04b0085e66fd46b9f412269da9ea668 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Fri, 26 Feb 2010 01:36:50 +0100 Subject: [PATCH] =?utf8?q?Ograniczenie=20test=C3=B3w=20do=20w=C5=82a=C5=9B?= =?utf8?q?ciwych=20pakiet=C3=B3w:=20wiki,=20vstorage,=20toolbar.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apps/wiki/tests.py | 18 +++++++++++++----- platforma/settings.py | 9 +++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) mode change 100755 => 100644 platforma/settings.py diff --git a/apps/wiki/tests.py b/apps/wiki/tests.py index 4262d208..91eccc8a 100644 --- a/apps/wiki/tests.py +++ b/apps/wiki/tests.py @@ -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 diff --git a/platforma/settings.py b/platforma/settings.py old mode 100755 new mode 100644 index 6a1a12ed..2c4e6588 --- a/platforma/settings.py +++ b/platforma/settings.py @@ -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/' -- 2.20.1