本文整理汇总了Python中trytond.tests.test_tryton.install_module函数的典型用法代码示例。如果您正苦于以下问题:Python install_module函数的具体用法?Python install_module怎么用?Python install_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了install_module函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
install_module('test')
self.one2many = POOL.get('test.copy.one2many')
self.one2many_target = POOL.get('test.copy.one2many.target')
self.one2many_reference = POOL.get('test.copy.one2many_reference')
self.one2many_reference_target = \
POOL.get('test.copy.one2many_reference.target')
开发者ID:Sisouvan,项目名称:ogh,代码行数:7,代码来源:test_copy.py
示例2: install_module
def install_module(request, monkeypatch):
"""Install tryton module in specified database.
"""
if request.param == 'sqlite':
monkeypatch.setenv('DB_NAME', ':memory:')
else:
monkeypatch.setenv('DB_NAME', 'test_' + str(int(time.time())))
from trytond.tests import test_tryton
test_tryton.install_module('audit_trail')
开发者ID:openlabs,项目名称:trytond-audit-trail,代码行数:10,代码来源:conftest.py
示例3: install_module
def install_module(request):
"""Install tryton module in specified database.
"""
if request.config.getoption("--db") == 'sqlite':
os.environ['TRYTOND_DATABASE_URI'] = "sqlite://"
os.environ['DB_NAME'] = ':memory:'
elif request.config.getoption("--db") == 'postgres':
os.environ['TRYTOND_DATABASE_URI'] = "postgresql://"
os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
from trytond.tests import test_tryton
test_tryton.install_module('payment_gateway_stripe')
开发者ID:usudaysingh,项目名称:trytond-payment-gateway-stripe,代码行数:13,代码来源:conftest.py
示例4: setUp
def setUp(self):
install_module('test')
self.boolean = POOL.get('test.import_data.boolean')
self.integer = POOL.get('test.import_data.integer')
self.float = POOL.get('test.import_data.float')
self.numeric = POOL.get('test.import_data.numeric')
self.char = POOL.get('test.import_data.char')
self.text = POOL.get('test.import_data.text')
self.sha = POOL.get('test.import_data.sha')
self.date = POOL.get('test.import_data.date')
self.datetime = POOL.get('test.import_data.datetime')
self.selection = POOL.get('test.import_data.selection')
self.many2one = POOL.get('test.import_data.many2one')
self.many2many = POOL.get('test.import_data.many2many')
self.one2many = POOL.get('test.import_data.one2many')
self.reference = POOL.get('test.import_data.reference')
开发者ID:mediafactory,项目名称:tryton_core_daemon,代码行数:16,代码来源:test_importdata.py
示例5: install_module
def install_module(request):
"""Install tryton module in specified database.
"""
reuse_db = request.config.getoption("--reuse-db")
if request.config.getoption("--db") == 'sqlite':
os.environ['TRYTOND_DATABASE_URI'] = "sqlite://"
if reuse_db:
# A hack to check if the database exists and if it
# does, load that and run tests.
Database = backend.get('Database')
# cursor.test forgets to set flavor!
# no time to report a bug!
Flavor.set(Database.flavor)
os.environ['DB_NAME'] = 'fulfilio'
else:
os.environ['DB_NAME'] = ':memory:'
elif request.config.getoption("--db") == 'postgres':
os.environ['TRYTOND_DATABASE_URI'] = "postgresql://"
if reuse_db:
os.environ['DB_NAME'] = 'test_fulfilio'
else:
os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
if reuse_db:
Database = backend.get('Database')
database = Database().connect()
cursor = database.cursor()
databases = database.list(cursor)
cursor.close()
if os.environ['DB_NAME'] in databases:
if request.config.getoption("--reset-db"):
cursor = database.cursor()
databases = database.drop(cursor, os.environ['DB_NAME'])
cursor.close()
else:
# tryton test forgets to init the pool
# for existing database
Pool(os.environ['DB_NAME']).init()
config.set('database', 'uri', os.environ['TRYTOND_DATABASE_URI'])
from trytond.tests import test_tryton
test_tryton.install_module('payment_gateway_stripe')
开发者ID:fulfilio,项目名称:trytond-payment-gateway-stripe,代码行数:45,代码来源:conftest.py
示例6: install_module
def install_module(request):
"""Install tryton module in specified database.
"""
if request.config.getoption("--db") == 'sqlite':
os.environ['TRYTOND_DATABASE_URI'] = "sqlite://"
os.environ['DB_NAME'] = ':memory:'
elif request.config.getoption("--db") == 'postgres':
os.environ['TRYTOND_DATABASE_URI'] = "postgresql://"
os.environ['DB_NAME'] = 'test_' + str(int(time.time()))
config.set('database', 'uri', os.environ['TRYTOND_DATABASE_URI'])
os.environ['TRYTOND_ENCRYPTED_FIELD__SECRET_KEY'] = Fernet.generate_key()
from trytond.tests import test_tryton
from trytond.pool import Pool
Pool.register(
EncryptedCharField,
EncryptedTextField,
EncryptedSelectionField,
module='tests', type_='model'
)
test_tryton.install_module('tests')
开发者ID:fulfilio,项目名称:trytond-encrypted-field,代码行数:23,代码来源:conftest.py
示例7: setUp
def setUp(self):
install_module('tests')
self.sequence = POOL.get('ir.sequence')
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:3,代码来源:test_sequence.py
示例8: setUp
def setUp(self):
install_module("test")
self.wizard = POOL.get("test.test_wizard", type="wizard")
self.session = POOL.get("ir.session.wizard")
开发者ID:mediafactory,项目名称:tryton_core_daemon,代码行数:4,代码来源:test_wizard.py
示例9: setUp
def setUp(self):
install_module('test')
self.singleton = POOL.get('test.singleton')
开发者ID:Sisouvan,项目名称:ogh,代码行数:3,代码来源:test_modelsingleton.py
示例10: setUp
def setUp(self):
install_module('test')
self.export_data = POOL.get('test.export_data')
self.export_data_target = POOL.get('test.export_data.target')
self.export_data_relation = POOL.get('test.export_data.relation')
开发者ID:mediafactory,项目名称:tryton_core_daemon,代码行数:5,代码来源:test_exportdata.py
示例11: setUpClass
def setUpClass(cls):
install_module('tests')
开发者ID:kret0s,项目名称:tryton3_8,代码行数:2,代码来源:test_importdata.py
示例12: setUp
def setUp(self):
install_module('tests')
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:2,代码来源:test_modelstorage.py
示例13: setUp
def setUp(self):
install_module('test')
self.field_access = POOL.get('ir.model.field.access')
self.test_access = POOL.get('test.access')
self.field = POOL.get('ir.model.field')
self.group = POOL.get('res.group')
开发者ID:mediafactory,项目名称:tryton_core_daemon,代码行数:6,代码来源:test_access.py
示例14: setUp
def setUp(self):
install_module('test')
self.modelsql = POOL.get('test.modelsql')
开发者ID:Sisouvan,项目名称:ogh,代码行数:3,代码来源:test_modelsql.py
示例15: setUp
def setUp(self):
install_module('res')
self.user = POOL.get('res.user')
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:3,代码来源:test_user.py
示例16: setUp
def setUp(self):
install_module('tests')
self.triggered = POOL.get('test.triggered')
self.trigger = POOL.get('ir.trigger')
self.trigger_log = POOL.get('ir.trigger.log')
self.model = POOL.get('ir.model')
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:6,代码来源:test_trigger.py
示例17: setUp
def setUp(self):
install_module('test')
self.wizard = POOL.get('test.test_wizard', type='wizard')
self.session = POOL.get('ir.session.wizard')
self.group = POOL.get('res.group')
开发者ID:Sisouvan,项目名称:ogh,代码行数:5,代码来源:test_wizard.py
示例18: setUp
def setUp(self):
install_module('tests')
self.workflow = POOL.get('test.workflowed')
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:3,代码来源:test_workflow.py
示例19: setUp
def setUp(self):
install_module('test')
self.mptt = POOL.get('test.mptt')
开发者ID:Sisouvan,项目名称:ogh,代码行数:3,代码来源:test_mptt.py
示例20: setUp
def setUp(self):
install_module('tests')
self.modelsql = POOL.get('test.modelsql')
self.modelsql_timestamp = POOL.get('test.modelsql.timestamp')
开发者ID:kret0s,项目名称:gnuhealth-live,代码行数:4,代码来源:test_modelsql.py
注:本文中的trytond.tests.test_tryton.install_module函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论