本文整理汇总了Python中ckan.tests.mock_mail_server.SmtpServerHarness.setup_class方法的典型用法代码示例。如果您正苦于以下问题:Python SmtpServerHarness.setup_class方法的具体用法?Python SmtpServerHarness.setup_class怎么用?Python SmtpServerHarness.setup_class使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ckan.tests.mock_mail_server.SmtpServerHarness
的用法示例。
在下文中一共展示了SmtpServerHarness.setup_class方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
model.repo.rebuild_db()
DguCreateTestData.create_dgu_test_data()
cls.publisher_controller = 'ckanext.dgu.controllers.publisher:PublisherController'
import ckanext.dgu.model.publisher_request as pr_model
pr_model.init_tables(model.meta.engine)
SmtpServerHarness.setup_class()
示例2: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
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)
SmtpServerHarness.setup_class()
PylonsTestCase.setup_class()
示例3: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
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)
CreateTestData.create_user(name="bob", email="[email protected]")
CreateTestData.create_user(name="mary") # NB No email addr provided
SmtpServerHarness.setup_class()
PylonsTestCase.setup_class()
示例4: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
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)
CreateTestData.create_user(name='bob', email='[email protected]')
CreateTestData.create_user(name='mary') #NB No email addr provided
SmtpServerHarness.setup_class()
PylonsTestCase.setup_class()
示例5: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(self):
PylonsTestCase.setup_class()
SmtpServerHarness.setup_class()
CreateTestData.create()
# make 3 changes, authored by annafan
for i in range(3):
rev = model.repo.new_revision()
pkg = model.Package.by_name(u'annakarenina')
pkg.notes = u'Changed notes %i' % i
rev.author = u'annafan'
model.repo.commit_and_remove()
CreateTestData.create_user('unfinisher', about='<a href="http://unfinished.tag')
CreateTestData.create_user('uncloser', about='<a href="http://unclosed.tag">')
CreateTestData.create_user('spammer', about=u'<a href="http://mysite">mysite</a> <a href=\u201dhttp://test2\u201d>test2</a>')
CreateTestData.create_user('spammer2', about=u'<a href="http://spamsite1.com\u201d>spamsite1</a>\r\n<a href="http://www.spamsite2.com\u201d>spamsite2</a>\r\n')
示例6: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
DguCreateTestData.create_dgu_test_data()
cls.publisher_controller = 'ckanext.dgu.controllers.publisher:PublisherController'
SmtpServerHarness.setup_class()
示例7: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
CreateTestData.create_user(name='bob', email='[email protected]')
CreateTestData.create_user(name='mary') #NB No email addr provided
SmtpServerHarness.setup_class()
PylonsTestCase.setup_class()
示例8: setup_class
# 需要导入模块: from ckan.tests.mock_mail_server import SmtpServerHarness [as 别名]
# 或者: from ckan.tests.mock_mail_server.SmtpServerHarness import setup_class [as 别名]
def setup_class(cls):
SmtpServerHarness.setup_class()
PylonsTestCase.setup_class()