本文整理汇总了Python中trytond.tests.test_tryton.install_module函数的典型用法代码示例。如果您正苦于以下问题:Python install_module函数的具体用法?Python install_module怎么用?Python install_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了install_module函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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')
示例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')
示例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')
示例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')
示例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')
示例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')
示例7: setUp
def setUp(self):
install_module('tests')
self.sequence = POOL.get('ir.sequence')
示例8: setUp
def setUp(self):
install_module("test")
self.wizard = POOL.get("test.test_wizard", type="wizard")
self.session = POOL.get("ir.session.wizard")
示例9: setUp
def setUp(self):
install_module('test')
self.singleton = POOL.get('test.singleton')
示例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')
示例11: setUpClass
def setUpClass(cls):
install_module('tests')
示例12: setUp
def setUp(self):
install_module('tests')
示例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')
示例14: setUp
def setUp(self):
install_module('test')
self.modelsql = POOL.get('test.modelsql')
示例15: setUp
def setUp(self):
install_module('res')
self.user = POOL.get('res.user')