test: correct some try/except test

bzr revid: laetitia.gangloff@acsone.eu-20130808143622-7kk0p7ve786kg1yd
This commit is contained in:
Laetitia Gangloff (Acsone) 2013-08-08 16:36:22 +02:00
parent 8938503a39
commit 3a369e15c2
3 changed files with 9 additions and 5 deletions

View File

@ -67,9 +67,10 @@
Then I cancel Bank Statements and verifies that it raises a warning
-
!python {model: account.bank.statement}: |
from openerp.osv import osv
try:
self.button_cancel(cr, uid, [ref("account_bank_statement_0")])
assert False, "An exception should have been raised, the journal should not let us cancel moves!"
except Exception:
except osv.except_osv:
# exception was raised as expected, as the journal does not allow cancelling moves
pass

View File

@ -73,14 +73,16 @@
I cancel the account move which is in posted state and verifies that it gives warning message
-
!python {model: account.move}: |
from openerp.osv import osv
inv_obj = self.pool.get('account.invoice')
inv = inv_obj.browse(cr, uid, ref('account_invoice_supplier0'))
try:
mov_cancel = self.button_cancel(cr, uid, [inv.move_id.id], {'lang': u'en_US', 'tz': False,
'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'active_ids': [ref('menu_action_invoice_tree2')],
'type': 'in_invoice', 'active_id': ref('menu_action_invoice_tree2')})
except Exception, e:
assert e, 'Warning message has not been raised'
assert False, "This should never happen!"
except osv.except_osv, e:
pass
-
I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values
-

View File

@ -61,12 +61,13 @@
!python {model: hr_timesheet_sheet.sheet}: |
uid = ref('base.user_root')
import netsvc
from openerp.osv import osv
try:
self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"active_ids":
[ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")],"active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"),
})
assert True, "The validation of the timesheet was unexpectedly accepted despite the 2:30 hours of difference"
except:
assert False, "The validation of the timesheet was unexpectedly accepted despite the 2:30 hours of difference"
except osv.except_osv, e:
pass
-
I Modified the timesheet record and make the difference less than 1 hour.