本文整理匯總了Python中ckan.tests.helpers.reset_db方法的典型用法代碼示例。如果您正苦於以下問題:Python helpers.reset_db方法的具體用法?Python helpers.reset_db怎麽用?Python helpers.reset_db使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ckan.tests.helpers
的用法示例。
在下文中一共展示了helpers.reset_db方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setup_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def setup_class(cls):
helpers.reset_db()
smtp_server = config.get('smtp.test_server')
if smtp_server:
host, port = smtp_server.split(':')
port = (int(port) +
int(str(hashlib.md5(cls.__name__).hexdigest())[0], 16))
config['smtp.test_server'] = '%s:%s' % (host, port)
# Created directly to avoid email validation
user_without_email = model.User(name='mary', email=None)
model.Session.add(user_without_email)
model.Session.commit()
SmtpServerHarness.setup_class()
示例2: setup
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def setup(self):
test_helpers.reset_db()
示例3: setup_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def setup_class(cls):
super(cls, cls).setup_class()
helpers.reset_db()
示例4: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
super(TestEndpoints, cls).teardown_class()
helpers.reset_db()
示例5: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
helpers.reset_db()
示例6: teardown
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown(cls):
h.reset_db()
示例7: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
p.unload('webpage_view')
super(TestWebPageView, cls).teardown_class()
helpers.reset_db()
示例8: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
p.unload('image_view')
super(TestImageView, cls).teardown_class()
helpers.reset_db()
示例9: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
plugins.unload('example_iconfigurer')
config['ckan.datasets_per_page'] = \
cls._datasets_per_page_original_value
helpers.reset_db()
示例10: setup
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def setup(self):
helpers.reset_db()
示例11: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
p.unload('datastore')
helpers.reset_db()
示例12: setup_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def setup_class(cls):
if not p.plugin_loaded('datastore'):
p.load('datastore')
if not p.plugin_loaded('datapusher'):
p.load('datapusher')
helpers.reset_db()
示例13: setup_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def setup_class(cls):
if not is_datastore_supported():
raise nose.SkipTest('Datastore not supported')
if not p.plugin_loaded('datastore'):
p.load('datastore')
if not p.plugin_loaded('datapusher'):
p.load('datapusher')
if not p.plugin_loaded('recline_grid_view'):
p.load('recline_grid_view')
helpers.reset_db()
示例14: teardown_class
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown_class(cls):
helpers.reset_db()
model.repo.rebuild_db()
ckan.lib.search.clear_all()
config.clear()
config.update(cls.original_config)
示例15: teardown
# 需要導入模塊: from ckan.tests import helpers [as 別名]
# 或者: from ckan.tests.helpers import reset_db [as 別名]
def teardown(self):
helpers.reset_db()