From a9e7f9eeb7de02188ff7b415c29c507d1d85574e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Aug 2011 16:57:26 +0200 Subject: [PATCH] Add test for depends --- company.py | 3 ++- tests/test_company.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/company.py b/company.py index 3f21e63f26..165c40239c 100644 --- a/company.py +++ b/company.py @@ -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__() diff --git a/tests/test_company.py b/tests/test_company.py index a03fed0aa1..946a176edd 100644 --- a/tests/test_company.py +++ b/tests/test_company.py @@ -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.