[FIX] account,hr_timesheet_sheet: fix YML assertRaise-like testcases that did not verify the result, courtesy of Laetitia Gangloff (Acsone)
bzr revid: odo@openerp.com-20130819142314-cirsm5jxg6e0uw02
This commit is contained in:
commit
8a9db0b58f
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
pass
|
||||
-
|
||||
I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values
|
||||
-
|
||||
|
|
|
@ -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:
|
||||
pass
|
||||
-
|
||||
I Modified the timesheet record and make the difference less than 1 hour.
|
||||
|
|
Loading…
Reference in New Issue