Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smotornyuk committed Aug 29, 2019
1 parent 1a9c4bc commit 2cc54a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions ckanext/datapusher/tests/test.py
Expand Up @@ -23,11 +23,13 @@ class TestDatastoreCreate():

@classmethod
def setup_class(cls):
cls._original_config = dict(config)
config['ckan.plugins'] = 'datastore datapusher'

cls.app = helpers._get_test_app()
if not tests.is_datastore_supported():
raise nose.SkipTest("Datastore not supported")
p.load('datastore')
p.load('datapusher')

ctd.CreateTestData.create()
cls.sysadmin_user = model.User.get('testsysadmin')
cls.normal_user = model.User.get('annafan')
Expand All @@ -41,6 +43,8 @@ def teardown_class(cls):
rebuild_all_dbs(cls.Session)
p.unload('datastore')
p.unload('datapusher')
config.clear()
config.update(cls._original_config)

def test_create_ckan_resource_in_package(self):
package = model.Package.get('annakarenina')
Expand Down
3 changes: 2 additions & 1 deletion ckanext/datastore/tests/helpers.py
Expand Up @@ -92,7 +92,8 @@ class DatastoreLegacyTestBase(object):
"""
@classmethod
def setup_class(cls):
p.load(u'datastore')
if not p.plugin_loaded(u'datastore'):
p.load(u'datastore')
reset_db()
search.clear_all()
engine = db.get_write_engine()
Expand Down
6 changes: 3 additions & 3 deletions ckanext/datastore/tests/test_dictionary.py
@@ -1,16 +1,16 @@
# encoding: utf-8

from ckanext.datastore.tests.helpers import DatastoreFunctionalTestBase, DatastoreLegacyTestBase
from ckanext.datastore.tests.helpers import DatastoreFunctionalTestBase
import ckan.tests.factories as factories
import ckan.tests.helpers as helpers


class TestDatastoreDictionary(DatastoreLegacyTestBase):
class TestDatastoreDictionary(DatastoreFunctionalTestBase):

@classmethod
def setup_class(cls):
cls.app = helpers._get_test_app()
super(TestDatastoreDictionary, cls).setup_class()
cls.app = helpers._get_test_app()

def test_read(self):
user = factories.User()
Expand Down

0 comments on commit 2cc54a4

Please sign in to comment.