本文整理汇总了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()