first commit
This commit is contained in:
2
modules/account_export/tests/__init__.py
Normal file
2
modules/account_export/tests/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
94
modules/account_export/tests/scenario_account_export.rst
Normal file
94
modules/account_export/tests/scenario_account_export.rst
Normal file
@@ -0,0 +1,94 @@
|
||||
=======================
|
||||
Account Export Scenario
|
||||
=======================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from decimal import Decimal
|
||||
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.modules.account.tests.tools import (
|
||||
... create_chart, create_fiscalyear, get_accounts)
|
||||
>>> from trytond.modules.company.tests.tools import create_company
|
||||
>>> from trytond.tests.tools import activate_modules
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules('account_export', create_company, create_chart)
|
||||
|
||||
>>> Journal = Model.get('account.journal')
|
||||
>>> Move = Model.get('account.move')
|
||||
>>> MoveExport = Model.get('account.move.export')
|
||||
>>> Party = Model.get('party.party')
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = create_fiscalyear()
|
||||
>>> fiscalyear.click('create_period')
|
||||
>>> period = fiscalyear.periods[0]
|
||||
|
||||
Get accounts::
|
||||
|
||||
>>> accounts = get_accounts()
|
||||
|
||||
Create party::
|
||||
|
||||
>>> party = Party(name="Party")
|
||||
>>> party.save()
|
||||
|
||||
Create a move::
|
||||
|
||||
>>> journal_revenue, = Journal.find([
|
||||
... ('code', '=', 'REV'),
|
||||
... ], limit=1)
|
||||
>>> move = Move()
|
||||
>>> move.period = period
|
||||
>>> move.journal = journal_revenue
|
||||
>>> move.date = period.start_date
|
||||
>>> line = move.lines.new()
|
||||
>>> line.account = accounts['revenue']
|
||||
>>> line.credit = Decimal(42)
|
||||
>>> line = move.lines.new()
|
||||
>>> line.account = accounts['receivable']
|
||||
>>> line.party = party
|
||||
>>> line.debit = Decimal(42)
|
||||
>>> move.save()
|
||||
>>> move.click('post')
|
||||
>>> move.state
|
||||
'posted'
|
||||
|
||||
Create move export::
|
||||
|
||||
>>> move_export = MoveExport()
|
||||
>>> move_export.save()
|
||||
>>> move_export.state
|
||||
'draft'
|
||||
>>> len(move_export.moves)
|
||||
0
|
||||
|
||||
Select moves for export::
|
||||
|
||||
>>> move_export.click('select_moves')
|
||||
>>> len(move_export.moves)
|
||||
1
|
||||
|
||||
Try to delete move export done::
|
||||
|
||||
>>> move_export.click('wait')
|
||||
>>> move_export.state
|
||||
'waiting'
|
||||
>>> move_export.click('wait')
|
||||
>>> move_export.click('do')
|
||||
>>> move_export.state
|
||||
'done'
|
||||
|
||||
>>> move_export.delete()
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
AccessError: ...
|
||||
|
||||
Copy move export does not copy moves::
|
||||
|
||||
>>> move_export, = move_export.duplicate()
|
||||
>>> len(move_export.moves)
|
||||
0
|
||||
11
modules/account_export/tests/test_module.py
Normal file
11
modules/account_export/tests/test_module.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class AccountExportTestCase(ModuleTestCase):
|
||||
"Test Account Export module"
|
||||
module = 'account_export'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
8
modules/account_export/tests/test_scenario.py
Normal file
8
modules/account_export/tests/test_scenario.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import load_doc_tests
|
||||
|
||||
|
||||
def load_tests(*args, **kwargs):
|
||||
return load_doc_tests(__name__, __file__, *args, **kwargs)
|
||||
Reference in New Issue
Block a user