Hi all,

I'm developing the 
account_es<https://bitbucket.org/trytonspain/trytond-account_es/overview>module 
for trytond 2.7 and it seems that works fine. I'd like to add python 
unit test to this module in order to allow checking its correct working 
after each modification, so I copied the unit test code from account module 
with some little modification (you can find the code in the above link, and 
obviously, the code is uncommented). But when I run the script, i get this 
message error: 

test0005views 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0006depends 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0010currencies 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0020mon_grouping 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0030rate 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0040rate_unicity 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0050compute_simple 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0060compute_nonfinite 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0070compute_nonfinite_worounding 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0080compute_same 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0090compute_zeroamount 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0100compute_zerorate 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0110compute_missingrate 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0120compute_bothmissingrate 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0130delete_cascade 
(trytond.modules.currency.tests.test_currency.CurrencyTestCase) ... ok
test0005views (trytond.modules.company.tests.test_company.CompanyTestCase) 
... ok
test0006depends 
(trytond.modules.company.tests.test_company.CompanyTestCase) ... ok
test0010company 
(trytond.modules.company.tests.test_company.CompanyTestCase) ... ok
test0020company_recursion 
(trytond.modules.company.tests.test_company.CompanyTestCase) ... ok
test0030employe 
(trytond.modules.company.tests.test_company.CompanyTestCase) ... ok
test0040user (trytond.modules.company.tests.test_company.CompanyTestCase) 
... ok
test0006depends (__main__.AccountEsTestCase) ... ok
Test of creation of Spanish chart of accounts ... ERROR
test0020fiscalyear (__main__.AccountEsTestCase) ... ERROR
test0030account_debit_credit (__main__.AccountEsTestCase) ... ERROR

======================================================================
ERROR: Test of creation of Spanish chart of accounts
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/jmartin/workspace/trytond/trytond/trytond/modules/account_es/tests/test_account_es.py",
 
line 68, in test0010account_chart
    ('company', '=', company.id),
ValueError: too many values to unpack

======================================================================
ERROR: test0020fiscalyear (__main__.AccountEsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/jmartin/workspace/trytond/trytond/trytond/modules/account_es/tests/test_account_es.py",
 
line 91, in test0020fiscalyear
    'company': company.id,
  File "/home/jmartin/workspace/trytond/trytond/trytond/ir/sequence.py", 
line 175, in create
    sequence_id = super(Sequence, cls).create(values)
  File "/home/jmartin/workspace/trytond/trytond/trytond/model/modelsql.py", 
line 367, in create
    cls.raise_user_error('access_error', cls.__name__)
  File "/home/jmartin/workspace/trytond/trytond/trytond/error.py", line 70, 
in raise_user_error
    raise UserError(error)
UserError: ('UserError', (u'You try to bypass an access rule!\n(Document 
type: ir.sequence)', ''))

======================================================================
ERROR: test0030account_debit_credit (__main__.AccountEsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/jmartin/workspace/trytond/trytond/trytond/modules/account_es/tests/test_account_es.py",
 
line 110, in test0030account_debit_credit
    fiscalyear, = self.fiscalyear.search([])
ValueError: need more than 0 values to unpack

----------------------------------------------------------------------
Ran 25 tests in 1135.195s

FAILED (errors=3)

Could anyone tell me what is wrong in the code?

Thanks a lot.

-- 
-- 
[email protected] mailing list



Reply via email to