mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[add] account_move_batch_validate: yaml test
This commit is contained in:
committed by
Iryna Vushnevska
parent
78e6560d09
commit
266082e5bb
@@ -44,7 +44,9 @@
|
||||
'wizard/move_marker_view.xml',
|
||||
],
|
||||
'demo_xml': [],
|
||||
'test': [],
|
||||
'test': [
|
||||
'test/batch_validate.yml'
|
||||
],
|
||||
'installable': True,
|
||||
'images': [],
|
||||
'license': 'AGPL-3',
|
||||
|
||||
48
account_move_batch_validate/test/batch_validate.yml
Normal file
48
account_move_batch_validate/test/batch_validate.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
-
|
||||
I create a move
|
||||
-
|
||||
!record {model: account.move, id: move1}:
|
||||
journal_id: account.sales_journal
|
||||
line_id:
|
||||
- name: Receivable line
|
||||
account_id: account.a_recv
|
||||
debit: 1000.0
|
||||
- name: Sales line
|
||||
account_id: account.a_sale
|
||||
credit: 1000.0
|
||||
-
|
||||
I check that the move is still draft
|
||||
-
|
||||
!assert {model: account.move, id: move1}:
|
||||
- state == 'draft'
|
||||
-
|
||||
I create a wizard
|
||||
-
|
||||
!record {model: account.move.marker, id: wiz_marker1}:
|
||||
action: mark
|
||||
-
|
||||
I run the wizard
|
||||
-
|
||||
!python {model: account.move.marker}: |
|
||||
self.button_mark(
|
||||
cr, uid, [ref('wiz_marker1')], context=context
|
||||
)
|
||||
-
|
||||
I read the UUID from the move, I dequeue the job and run it
|
||||
-
|
||||
!python {model: account.move}: |
|
||||
from openerp.addons.connector.queue.job import OpenERPJobStorage
|
||||
from openerp.addons.connector.session import ConnectorSession
|
||||
|
||||
move = self.browse(cr, uid, ref('move1'), context=context)
|
||||
uuid = move.post_job_uuid
|
||||
session = ConnectorSession(cr, uid, context=context)
|
||||
storage = OpenERPJobStorage(session)
|
||||
|
||||
myjob = storage.load(uuid)
|
||||
myjob.perform(session)
|
||||
-
|
||||
I check that the move is now approved
|
||||
-
|
||||
!assert {model: account.move, id: move1}:
|
||||
- state == 'posted'
|
||||
Reference in New Issue
Block a user