From 6c1514efded642155fadcc2ddadbf0eca44e1b74 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Wed, 19 Apr 2017 17:27:09 +0200 Subject: [PATCH] Change __init__ import and rename test --- __init__.py | 12 ++++++------ account.py | 6 ++---- account.xml | 4 +++- tests/test_account_import_contaplus.py | 14 ++++---------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/__init__.py b/__init__.py index 1231921..e6e7533 100644 --- a/__init__.py +++ b/__init__.py @@ -1,16 +1,16 @@ # The COPYRIGHT file at the top level of this repository contains the full # copyright notices and license terms. from trytond.pool import Pool -from .account import * +from . import account def register(): Pool.register( - AccountImportContaplusStart, - ImportRecord, - Move, - Invoice, + account.AccountImportContaplusStart, + account.ImportRecord, + account.Move, + account.Invoice, module='account_import_contaplus', type_='model') Pool.register( - AccountImportContaplus, + account.AccountImportContaplus, module='account_import_contaplus', type_='wizard') diff --git a/account.py b/account.py index 4f6a7f2..a0f5c30 100644 --- a/account.py +++ b/account.py @@ -9,10 +9,8 @@ from trytond.pool import Pool, PoolMeta from trytond.wizard import Wizard, StateTransition, StateView, Button from trytond.transaction import Transaction -__all__ = [ - 'AccountImportContaplus', 'AccountImportContaplusStart', 'ImportRecord', - 'Move', 'Invoice' -] +__all__ = ['AccountImportContaplus', 'AccountImportContaplusStart', + 'ImportRecord', 'Move', 'Invoice'] logger = logging.getLogger(__name__) diff --git a/account.xml b/account.xml index e2bc275..4504915 100644 --- a/account.xml +++ b/account.xml @@ -12,7 +12,9 @@ Import Contaplus File account.import.contaplus + - + diff --git a/tests/test_account_import_contaplus.py b/tests/test_account_import_contaplus.py index 2b4e6e9..e2328b6 100644 --- a/tests/test_account_import_contaplus.py +++ b/tests/test_account_import_contaplus.py @@ -1,15 +1,12 @@ # The COPYRIGHT file at the top level of this repository contains the full # copyright notices and license terms. import unittest -# import doctest import trytond.tests.test_tryton from trytond.tests.test_tryton import test_view, test_depends -# TODO: Remove if no sceneario needed. -# from trytond.tests.test_tryton import doctest_setup, doctest_teardown -class TestCase(unittest.TestCase): - 'Test module' +class AccountImportContaplusTestCase(unittest.TestCase): + 'Test Account Import Contaplus module' def setUp(self): trytond.tests.test_tryton.install_module('account_import_contaplus') @@ -25,9 +22,6 @@ class TestCase(unittest.TestCase): def suite(): suite = trytond.tests.test_tryton.suite() - suite.addTests(unittest.TestLoader().loadTestsFromTestCase(TestCase)) - # TODO: remove if no scenario needed. - #suite.addTests(doctest.DocFileSuite('scenario_account_import_contaplus.rst', - # setUp=doctest_setup, tearDown=doctest_teardown, encoding='utf-8', - # optionflags=doctest.REPORT_ONLY_FIRST_FAILURE)) + suite.addTests(unittest.TestLoader().loadTestsFromTestCase( + AccountImportContaplusTestCase)) return suite