Skip to content

Commit

Permalink
[#642] Add plugin loading and unloading. This does not fix the single…
Browse files Browse the repository at this point in the history
…ton issue but is better anyway.
  • Loading branch information
domoritz committed Apr 3, 2013
1 parent a4d88b7 commit d76c657
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ckanext/datastore/tests/test_configure.py
@@ -1,12 +1,16 @@
import unittest
import ckan.plugins as p
from nose.tools import raises

import ckanext.datastore.plugin as plugin


class TestConfiguration(unittest.TestCase):
def setUp(self):
self.p = plugin.DatastorePlugin()
self.p = p.load('datastore')

def tearDown(self):
p.unload('datastore')

def test_legacy_mode_default(self):
assert not self.p.legacy_mode
Expand Down Expand Up @@ -46,7 +50,7 @@ def test_same_ckan_and_datastore_db(self):

class TestCheckUrlsAndPermissions(unittest.TestCase):
def setUp(self):
self.p = plugin.DatastorePlugin()
self.p = p.load('datastore')

self.p.legacy_mode = False

Expand All @@ -64,6 +68,9 @@ def raise_datastore_exception(message):
raise plugin.DatastoreException(message)
self.p._log_or_raise = raise_datastore_exception

def tearDown(self):
p.unload('datastore')

def test_everything_correct_does_not_raise(self):
self.p._check_urls_and_permissions()

Expand Down

0 comments on commit d76c657

Please sign in to comment.