[imp] account_move_batch_validate: with a little trick, tests are back!

This commit is contained in:
Leonardo Pistone
2014-02-28 12:58:05 +01:00
parent b06d77c635
commit bd8dff2448
4 changed files with 9 additions and 3 deletions

View File

@@ -71,8 +71,8 @@
'wizard/move_marker_view.xml',
],
'test': [
# 'test/batch_validate.yml',
# 'test/batch_validate_then_unmark.yml',
'test/batch_validate.yml',
'test/batch_validate_then_unmark.yml',
],
'installable': True,
'images': [],

View File

@@ -24,6 +24,7 @@
I run the wizard
-
!python {model: account.move.marker}: |
context['automated_test_execute_now'] = True
self.button_mark(
cr, uid, [ref('wiz_marker1')], context=context
)

View File

@@ -25,6 +25,7 @@
I run the wizard
-
!python {model: account.move.marker}: |
context['automated_test_execute_now'] = True
self.button_mark(
cr, uid, [ref('wiz_marker2')], context=context
)

View File

@@ -57,7 +57,11 @@ class AccountMoveMarker(orm.TransientModel):
wizard_data = self.read(cr, uid, wizard_id, context=context,
load='_classic_write')
wizard_data.pop('id')
process_wizard.delay(session, self._name, wizard_data)
if context.get('automated_test_execute_now'):
process_wizard(session, self._name, wizard_data)
else:
process_wizard.delay(session, self._name, wizard_data)
return {'type': 'ir.actions.act_window_close'}