diff --git a/addons/hr_expense/__openerp__.py b/addons/hr_expense/__openerp__.py index 1114cf3c18a..0d7be99c030 100644 --- a/addons/hr_expense/__openerp__.py +++ b/addons/hr_expense/__openerp__.py @@ -63,8 +63,8 @@ re-invoice your customer's expenses if your work by project. 'hr_expense_demo.xml', ], 'test': [ - 'test/expense_process.yml', 'test/expense_demo.yml', + 'test/expense_process.yml', ], 'installable': True, 'active': False, diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml index 7e079b21e14..6e575aec782 100644 --- a/addons/hr_expense/hr_expense_demo.xml +++ b/addons/hr_expense/hr_expense_demo.xml @@ -2,7 +2,7 @@ - + @@ -34,7 +34,7 @@ - + September Expenses diff --git a/addons/hr_expense/test/expense_demo.yml b/addons/hr_expense/test/expense_demo.yml index cd88448fefa..c5cc9001a5e 100644 --- a/addons/hr_expense/test/expense_demo.yml +++ b/addons/hr_expense/test/expense_demo.yml @@ -1,7 +1,7 @@ - - !record {model: hr.expense.expense, id: hr.employee3, view: False}: - employee_id: 'hr.employee3' - name : 'Antoine Philippe' + !record {model: hr.expense.expense, id: hr_expense01, view: False}: + employee_id: 'hr.employee4' + name : 'John Smith' - !record {model: product.product, id: car_travel, view: False}: hr_expense_ok: 'True' diff --git a/addons/hr_expense/test/expense_process.yml b/addons/hr_expense/test/expense_process.yml index 654b28bde5e..1c02e4b6f5c 100644 --- a/addons/hr_expense/test/expense_process.yml +++ b/addons/hr_expense/test/expense_process.yml @@ -1,25 +1,35 @@ - - In Order to test process of "Employee Expenses". + I test the process of "Employee Expenses" by processing the expenses of an employee for September month - - I confirm "Expense Bill of September" for one employee of Marketing Department. + I check that state is 'Draft'. +- + !assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Draft state}: + - state == 'draft' +- + I change the state. - !workflow {model: hr.expense.expense, action: confirm, ref: sep_expenses} - - I check state of expense after confirmed. + I check that state is 'Confirm'. - - !assert {model: hr.expense.expense, id: sep_expenses}: + !assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Confirm state}: - state == 'confirm' - - I accept this expense. + I approve the September expenses. - !workflow {model: hr.expense.expense, action: validate, ref: sep_expenses} +- + I check that state is 'Approved' +- + !assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Approved state}: + - state == 'accepted' - I make Invoice for the expense. - !python {model: hr.expense.expense}: | self.invoice(cr, uid, [ref('sep_expenses')]) - - I check invoice details after invoiced. + I check invoice details. - !python {model: hr.expense.expense}: | sep_expenses = self.browse(cr, uid, ref("sep_expenses"), context=context) @@ -31,17 +41,17 @@ assert sep_expenses.invoice_id.amount_total == sep_expenses.amount,"Invoice total amount is not correspond with supplier invoice total" assert len(sep_expenses.invoice_id.invoice_line) == len(sep_expenses.line_ids),"Lines of Invoice and supplier invoice Line are not correspond" - - I paid the expense. + I pay the expenses. - !python {model: hr.expense.expense}: | self.expense_paid(cr, uid, [ref('sep_expenses')]) - - I check the expense after paid. + I check that state of expenses is 'Paid'. - - !assert {model: hr.expense.expense, id: sep_expenses}: + !assert {model: hr.expense.expense, id: sep_expenses, severity: error, string: Expense should be in Paid state}: - state == 'paid' - - I print this expense. + I print a report of the expenses. - !python {model: hr.expense.expense}: | import netsvc, tools, os