[IMP] impex tests: moved test cases and models in their own test module.
bzr revid: vmt@openerp.com-20120807143744-zsbwktjmy5d79jki
This commit is contained in:
parent
346397530d
commit
00d2d2fe05
|
@ -9,7 +9,7 @@ See the :ref:`test-framework` section in the :ref:`features` list.
|
|||
"""
|
||||
|
||||
from . import test_expression, test_ir_sequence, test_orm,\
|
||||
test_uninstall, test_export, test_import
|
||||
test_uninstall
|
||||
|
||||
fast_suite = [
|
||||
test_ir_sequence,
|
||||
|
@ -18,8 +18,6 @@ fast_suite = [
|
|||
checks = [
|
||||
test_expression,
|
||||
test_orm,
|
||||
test_export,
|
||||
test_import,
|
||||
]
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
import models
|
|
@ -0,0 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
'name': 'test-import-export',
|
||||
'version': '0.1',
|
||||
'category': 'Tests',
|
||||
'description': """A module to test import/export.""",
|
||||
'author': 'OpenERP SA',
|
||||
'maintainer': 'OpenERP SA',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base'],
|
||||
'data': [],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -34,7 +34,6 @@ models = [
|
|||
for name, field in models:
|
||||
attrs = {
|
||||
'_name': 'export.%s' % name,
|
||||
'_module': 'base',
|
||||
'_columns': {
|
||||
'const': fields.integer(),
|
||||
'value': field
|
||||
|
@ -57,7 +56,6 @@ for name, field in models:
|
|||
|
||||
class One2ManyChild(orm.Model):
|
||||
_name = 'export.one2many.child'
|
||||
_module = 'base'
|
||||
# FIXME: orm.py:1161, fix to name_get on m2o field
|
||||
_rec_name = 'value'
|
||||
|
||||
|
@ -72,7 +70,6 @@ class One2ManyChild(orm.Model):
|
|||
|
||||
class One2ManyMultiple(orm.Model):
|
||||
_name = 'export.one2many.multiple'
|
||||
_module = 'base'
|
||||
|
||||
_columns = {
|
||||
'const': fields.integer(),
|
||||
|
@ -83,7 +80,6 @@ class One2ManyMultiple(orm.Model):
|
|||
|
||||
class One2ManyChildMultiple(orm.Model):
|
||||
_name = 'export.one2many.multiple.child'
|
||||
_module = 'base'
|
||||
# FIXME: orm.py:1161, fix to name_get on m2o field
|
||||
_rec_name = 'value'
|
||||
|
||||
|
@ -97,16 +93,13 @@ class One2ManyChildMultiple(orm.Model):
|
|||
for record in self.browse(cr, uid, ids, context=context)]
|
||||
class One2ManyChild1(orm.Model):
|
||||
_name = 'export.one2many.child.1'
|
||||
_module = 'base'
|
||||
_inherit = 'export.one2many.multiple.child'
|
||||
class One2ManyChild2(orm.Model):
|
||||
_name = 'export.one2many.child.2'
|
||||
_module = 'base'
|
||||
_inherit = 'export.one2many.multiple.child'
|
||||
|
||||
class Many2ManyChild(orm.Model):
|
||||
_name = 'export.many2many.other'
|
||||
_module = 'base'
|
||||
# FIXME: orm.py:1161, fix to name_get on m2o field
|
||||
_rec_name = 'value'
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import test_export, test_import
|
||||
|
||||
fast_suite = [
|
||||
]
|
||||
|
||||
checks = [
|
||||
test_export,
|
||||
test_import,
|
||||
]
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -3,13 +3,11 @@ import itertools
|
|||
import openerp.modules.registry
|
||||
import openerp
|
||||
|
||||
from . import common, export_models
|
||||
from openerp.tests import common
|
||||
|
||||
|
||||
def setUpModule():
|
||||
openerp.tools.config['update'] = {'base': 1}
|
||||
openerp.modules.registry.RegistryManager.new(
|
||||
common.DB, update_module=True)
|
||||
|
||||
class CreatorCase(common.TransactionCase):
|
||||
model_name = False
|
|
@ -2,7 +2,7 @@
|
|||
import openerp.modules.registry
|
||||
import openerp
|
||||
|
||||
from . import common, export_models
|
||||
from openerp.tests import common
|
||||
|
||||
def ok(n):
|
||||
""" Successful import of ``n`` records
|
||||
|
@ -28,8 +28,6 @@ def values(seq, field='value'):
|
|||
|
||||
def setupModule():
|
||||
openerp.tools.config['update'] = {'base': 1}
|
||||
openerp.modules.registry.RegistryManager.new(
|
||||
common.DB, update_module=True)
|
||||
|
||||
class ImporterCase(common.TransactionCase):
|
||||
model_name = False
|
Loading…
Reference in New Issue