Add test for depends

This commit is contained in:
Cédric Krier committed 2011-08-04 16:57:26 +02:00
1 parent 168bf3f881
commit a9e7f9eeb7
2 files changed
+10 -2

No files matched your search

+2 -1
View File
@@ -84,7 +84,8 @@ class User(ModelSQL, ModelView):
companies = fields.Function(fields.One2Many('company.company', None,
'Current Companies'), 'get_companies')
employee = fields.Many2One('company.employee', 'Employee',
domain=[('company', 'child_of', [Eval('main_company')], 'parent')])
domain=[('company', 'child_of', [Eval('main_company')], 'parent')],
depends=['main_company'])
def __init__(self):
super(User, self).__init__()
+8 -1
View File
@@ -9,7 +9,8 @@ if os.path.isdir(DIR):
import unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
test_depends
from trytond.transaction import Transaction
@@ -31,6 +32,12 @@ class CompanyTestCase(unittest.TestCase):
'''
test_view('company')
def test0006depends(self):
'''
Test depends.
'''
test_depends()
def test0010company(self):
'''
Create company.