Fix tests

This commit is contained in:
Guillem Barba 2016-10-06 16:02:04 +02:00
parent ef5b0fab32
commit f68094dc36
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,8 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from .test_analytic_line_state import suite
try:
from trytond.modules.analytic_line_state.tests.test_analytic_line_state import suite
except ImportError:
from .test_analytic_line_state import suite
__all__ = ['suite']

View file

@ -125,6 +125,9 @@ class TestCase(ModuleTestCase):
fiscalyear.save()
fiscalyear.create_period([fiscalyear])
period = fiscalyear.periods[0]
self.configure_analytic_accounts()
journal_revenue, = Journal.search([
('code', '=', 'REV'),
])
@ -247,6 +250,7 @@ class TestCase(ModuleTestCase):
fiscalyear.save()
fiscalyear.create_period([fiscalyear])
period = fiscalyear.periods[0]
journal_revenue, = Journal.search([
('code', '=', 'REV'),
])
@ -363,7 +367,7 @@ class TestCase(ModuleTestCase):
self.assertEqual(draft_move.state, 'posted')
@with_transaction()
def test0030account_configuration(self):
def test0040account_configuration(self):
'Test account configuration configuration'
pool = Pool()
Account = pool.get('account.account')
@ -380,7 +384,6 @@ class TestCase(ModuleTestCase):
root, = AnalyticAccount.search([
('type', '=', 'root')
])
self.assertGreater(len(root.analytic_pending_accounts), 0)
# Create Chart and Fiscalyear
create_chart(company)
@ -388,6 +391,9 @@ class TestCase(ModuleTestCase):
fiscalyear.save()
fiscalyear.create_period([fiscalyear])
period = fiscalyear.periods[0]
self.assertGreater(len(root.analytic_pending_accounts), 0)
journal_revenue, = Journal.search([
('code', '=', 'REV'),
])