X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3e1aff21cb6131f52bc4ef17187af665b31654a8..20222de6f21f5a4bbbc55386e9792d43b47faf17:/apps/wiki/tests.py?ds=inline diff --git a/apps/wiki/tests.py b/apps/wiki/tests.py index 4262d208..65777379 100644 --- a/apps/wiki/tests.py +++ b/apps/wiki/tests.py @@ -1,12 +1,19 @@ -import unittest +from nose.tools import * import wiki.models as models +import shutil +import tempfile -class TestDocument(unittest.TestCase): +class TestStorageBase: def setUp(self): - models.storage = None + self.dirpath = tempfile.mkdtemp(prefix='nosetest_') - def + def tearDown(self): + shutil.rmtree(self.dirpath) +class TestDocumentStorage(TestStorageBase): + def test_storage_empty(self): + storage = models.DocumentStorage(self.dirpath) + eq_(storage.all(), [])