Nimesh Contractor(Open ERP) has proposed merging
lp:~openerp-commiter/openobject-addons/trunk-hr_coverage-nco into
lp:~openerp-dev/openobject-addons/trunk-sale_hr_coverage-mra.
Requested reviews:
Mustufa Rangwala (Open ERP) (mra-tinyerp)
For more details, see:
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-hr_coverage-nco/+merge/71322
Hello sir,
I have improved yaml files for coverage of hr modules.
Thank You.
--
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-hr_coverage-nco/+merge/71322
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-sale_hr_coverage-mra.
=== modified file 'hr/test/test_hr.yml'
--- hr/test/test_hr.yml 2011-04-08 16:31:16 +0000
+++ hr/test/test_hr.yml 2011-08-12 09:38:22 +0000
@@ -18,6 +18,11 @@
user_id: base.user_root
department_id: 'hr_department_rd0'
-
+ I create Empoyee Category.
+-
+ !python {model: hr.employee.category}: |
+ self._name_get_fnc(cr, uid, [ref("hr_department_rd0")], prop='test', unknow_none=None, context=None)
+-
In order to check the wizard âEmployee Hierarchyâ , I will create new employee âPhil Graves â and select "Mark Johnson" as
Manager.
-
@@ -31,6 +36,26 @@
-
I will open up form view of âMark Johnsonâ and test the wizard âEmployee Hierarchyâ so it display the employee
hierarchy starting from âMark Johnsonâ.
+-
+ I change the address of an Employee.
+-
+ !python {model: hr.employee}: |
+ self.onchange_address_id(cr, uid, [ref("hr_employee_mark")], address="test", context=None)
+-
+ I change the company of an Employee.
+-
+ !python {model: hr.employee}: |
+ self.onchange_company(cr, uid, [ref("hr_employee_mark")], ref("base.main_company"), context=None)
+-
+ I change the Department it should change the respective manager.
+-
+ !python {model: hr.department}: |
+ dep = self._dept_name_get_fnc(cr, uid, [ref("hr_department_rd0")], prop='test', unknow_none=None, context=None)
+-
+ To unlink the Employee.
+-
+ !python {model: hr.employee}: |
+ self.unlink(cr, uid, [ref("hr_employee_mark")])
-
I will create new Job Position. I will check successfull creation of new Job Position by adding the information.
@@ -45,6 +70,34 @@
-
!assert {model: hr.job, id: hr_job_jea0}:
- state == 'open'
+-
+ I create open job position.
+-
+ !python {model: hr.job}: |
+ self.job_open(cr, uid, [ref("hr_job_jea0")], {"lang": 'en_US', "search_default_department_id": False, "tz": False, "active_model": 'ir.ui.menu', "department_id": False, "search_default_Current": 1, "active_ids": [ref("hr_job_jea0")], "active_id": ref("hr_job_jea0")})
+ self.write(cr, uid, [ref('hr_job_jea0')], {'state': 'open', 'no_of_recruitment': 0})
+-
+ I create old job position.
+-
+ !python {model: hr.job}: |
+ self.job_old(cr, uid, [ref("hr_job_jea0")], {"lang": 'en_US', "search_default_department_id": False, "tz": False, "active_model": 'ir.ui.menu', "department_id": False, "search_default_Current": 1, "active_ids": [ref("hr_job_jea0")], "active_id": ref("hr_job_jea0")})
+ self.write(cr, uid, [ref('hr_job_jea0')], {'state': 'old', 'no_of_recruitment': 0})
+-
+ I create number of recrutment for Job Recruitement.
+-
+ !python {model: hr.job}: |
+ self.job_recruitement(cr, uid, [ref("hr_job_jea0")], {"lang": 'en_US', "search_default_department_id": False, "tz": False, "active_model": 'ir.ui.menu', "department_id": False, "search_default_Current": 1, "active_ids": [ref("hr_job_jea0")], "active_id": ref("hr_job_jea0")})
+ for job in self.browse(cr, uid, [ref("hr_job_jea0")]):
+ no_of_recruitment = job.no_of_recruitment == 0 and 1 or job.no_of_recruitment
+ assert no_of_recruitment, _('No recruitment!')
+ self.write(cr, uid, [job.id], {'state': 'recruit', 'no_of_recruitment': no_of_recruitment})
+-
+ When I change Expected Recruitment it should change the Expected Employee.
+-
+ !python {model: hr.job}: |
+ emp = self.on_change_expected_employee(cr, uid, [ref("hr_job_jea0")], no_of_recruitment=5, no_of_employee=2, context=None)
+ assert emp, _('Expected Employee should be changed!')
+
-
I create Employee for job position.
@@ -55,7 +108,7 @@
name: Manuel Lehba
department_id: 'hr_department_rd0'
gender: male
- parent_id: 'hr_employee_mark'
+
-
I check that "Number of Employees" field have some value.
-
=== modified file 'hr_attendance/test/test_hr_attendance.yml'
--- hr_attendance/test/test_hr_attendance.yml 2011-01-14 00:11:01 +0000
+++ hr_attendance/test/test_hr_attendance.yml 2011-08-12 09:38:22 +0000
@@ -113,4 +113,26 @@
!record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson0}:
name: Mark Johnson
state: present
-
+-
+ Finally i will check the state of the employee is Absent.
+-
+ !record {model: hr.sign.in.out, id: hr_sign_in_out_markjohnson1}:
+ name: Mark Johnson
+ state: absent
+
+-
+ Now I open "Sign In sign out" wizard.
+-
+ !python {model: hr.sign.in.out.ask}: |
+ self._get_empname(cr, uid, context=None)
+
+-
+ Now I check si_check "Sign In sign out" wizard.
+-
+ !python {model: hr.sign.in.out}: |
+ self.si_check(cr, uid, [ref("hr_sign_in_out_markjohnson0")])
+-
+ Now I check so_check "Sign In sign out" wizard.
+-
+ !python {model: hr.sign.in.out}: |
+ self.so_check(cr, uid, [ref("hr_sign_in_out_markjohnson0")])
=== modified file 'hr_evaluation/test/test_hr_evaluation.yml'
--- hr_evaluation/test/test_hr_evaluation.yml 2011-07-12 13:46:15 +0000
+++ hr_evaluation/test/test_hr_evaluation.yml 2011-08-12 09:38:22 +0000
@@ -141,3 +141,50 @@
-
!python {model: hr_evaluation.evaluation}: |
self.button_done(cr, uid, [ref("hr_evaluation.hr_evaluation_evaluation_0")], {"active_ids": [ref("hr_evaluation.menu_open_view_hr_evaluation_tree")]})
+-
+ I check on change eveluation paln of Hr Employee.
+-
+ !python {model: hr.employee}: |
+ self.onchange_evaluation_plan_id(cr, uid, [ref("hr_evaluation_evaluation_0")], evaluation_plan_id=1, evaluation_date='08-08-2011 10:10:10', context=None)
+-
+ I check name_get of Hr Employee Evaluation.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ self.name_get(cr, uid, [ref("hr_evaluation_evaluation_0")], context=None)
+-
+ I check onchange_employee_id of Hr Employee Evaluation.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ self.onchange_employee_id(cr, uid, [ref("hr_evaluation_evaluation_0")], employee_id=1, context=None)
+-
+ I check button_cancel of Hr Employee Evaluation.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ self.button_cancel(cr, uid, [ref("hr_evaluation_evaluation_0")], context=None)
+-
+ I check button_draft of Hr Employee Evaluation.
+-
+ !python {model: hr_evaluation.evaluation}: |
+ self.button_draft(cr, uid, [ref("hr_evaluation_evaluation_0")], context=None)
+-
+ I check run_employee_evaluation of Hr Employee.
+-
+ !python {model: hr.employee}: |
+ self.run_employee_evaluation(cr, uid, automatic=False, use_new_cursor=False, context=None)
+-
+ I create an Evaluation for employee hr evaluation intreview.
+-
+ !record {model: hr.evaluation.interview', id: hr_evaluation_intreview_0}:
+ evaluation_id: ref('hr_evaluation_evaluation_0')
+-
+ I create an Evaluation for employee Evaluation .
+-
+ !record {model: hr.evaluation.reminder, id: hr_evaluation_reminder_0}:
+ evaluation_id: ref('hr_evaluation_intreview_0')
+-
+ I check send_mail function of Hr Evaluation Reminder.
+-
+ !python {model: hr.evaluation.reminder}: |
+ self.send_mail(cr, uid, [ref("hr_evaluation_reminder_0")][0], context={'lang': 'en_US', 'search_default_department_id': False, 'tz': False, 'active_model': 'hr.evaluation.reminder', 'department_id': False, 'section_id': False, 'search_default_user_id': ref('hr_evaluation_reminder_0'), 'search_default_current': 1, 'active_ids': [ref('hr_evaluation_reminder_0')], 'active_id': ref('hr_evaluation_reminder_0')})
+ #evaluation_data = self.read(cr, uid, [ref("hr_evaluation_evaluation_0")], context={'lang': 'en_US', 'search_default_department_id': False, 'tz': False, 'active_model': 'hr.evaluation.reminder', 'department_id': False, 'section_id': False, 'search_default_user_id': ref('hr_evaluation_evaluation_0'), 'search_default_current': 1, 'active_ids': [ref('hr_evaluation_evaluation_0')], 'active_id': ref('hr_evaluation_evaluation_0')})
+
\ No newline at end of file
=== modified file 'hr_expense/hr_expense.py'
--- hr_expense/hr_expense.py 2011-07-06 14:56:44 +0000
+++ hr_expense/hr_expense.py 2011-08-12 09:38:22 +0000
@@ -24,6 +24,7 @@
from osv import fields, osv
from tools.translate import _
import decimal_precision as dp
+import netsvc
def _employee_get(obj, cr, uid, context=None):
if context is None:
=== modified file 'hr_expense/test/test_hr_expense.yml'
--- hr_expense/test/test_hr_expense.yml 2011-01-14 00:11:01 +0000
+++ hr_expense/test/test_hr_expense.yml 2011-08-12 09:38:22 +0000
@@ -94,3 +94,24 @@
!python {model: hr.expense.expense}: |
exp = self.browse(cr, uid, [ref('hr_expense_expense_september0')])[0]
assert exp.invoice_id, "Invoice should be created"
+-
+ I check that copy for the expense.
+-
+ !python {model: hr.expense.expense}: |
+ self.copy(cr, uid, [ref('hr_expense_expense_september0')][0], default=None, context=None)
+-
+ I check that _get_currency for the expense.
+-
+ !python {model: hr.expense.expense}: |
+ self._get_currency(cr, uid, context=None)
+-
+ I check that invoice for the expense.
+-
+ !python {model: hr.expense.expense}: |
+ import netsvc
+ self.invoice(cr, uid, [ref('hr_expense_expense_september0')], context=None)
+-
+ I check that expense_canceled for the expense workflow method.
+-
+ !python {model: hr.expense.expense}: |
+ self.expense_canceled(cr, uid, [ref('hr_expense_expense_september0')])
=== modified file 'hr_holidays/test/test_hr_holiday.yml'
--- hr_holidays/test/test_hr_holiday.yml 2011-01-14 00:11:01 +0000
+++ hr_holidays/test/test_hr_holiday.yml 2011-08-12 09:38:22 +0000
@@ -104,3 +104,45 @@
-
I can also see Summary of Employee's holiday by using 'Employee's Holidays' Report. This report will allows to choose to print holidays with state Confirmed, Validated or both.
+
+-
+ I check get_days of hr holidays status'.
+-
+ !python {model: hr.holidays.status}: |
+ self.get_days(cr, uid, [ref("hr_holidays_iwanttoleaveforgotohospital0")], employee_id=1, return_false=0, context=None)
+-
+ I check _user_left_days of hr holidays status'.
+-
+ !python {model: hr.holidays.status}: |
+ self._user_left_days(cr, uid, [ref("hr_holidays_iwanttoleaveforgotohospital0")], name='name', args={}, context=None)
+-
+ I check _employee_get of hr holidays'.
+-
+ !python {model: hr.holidays}: |
+ self._employee_get(cr, uid, context=None)
+-
+ I check onchange_type of hr holidays'.
+-
+ !python {model: hr.holidays}: |
+ self.onchange_type(cr, uid, [ref("hr_holidays_iwanttoleaveforgotohospital0")], holiday_type='employee')
+-
+ I check _remove_resouce_leave of hr holidays'.
+-
+ !python {model: hr.holidays}: |
+ self._remove_resouce_leave(cr, uid, [ref("hr_holidays_iwanttoleaveforgotohospital0")])
+-
+ I check _get_number_of_days of hr holidays'.
+-
+ !python {model: hr.holidays}: |
+ self._get_number_of_days(date_from="2011-08-08 14:50:56", date_to="2011-08-09 14:50:56")
+-
+ I check onchange_date_from of hr holidays'.
+-
+ !python {model: hr.holidays}: |
+ self.onchange_date_from(cr, uid, [ref("hr_holidays_iwanttoleaveforgotohospital0")],date_from="2011-08-08 14:50:56", date_to="2011-08-09 14:50:56")
+-
+ I check holidays_refuse of hr holidays'.
+-
+ !python {model: hr.holidays}: |
+ self.holidays_refuse(cr, uid, [ref("hr_holidays_iwanttoleaveforgotohospital0")])
+
\ No newline at end of file
=== modified file 'hr_payroll/test/payslip.yml'
--- hr_payroll/test/payslip.yml 2011-07-11 10:27:54 +0000
+++ hr_payroll/test/payslip.yml 2011-08-12 09:38:22 +0000
@@ -91,4 +91,4 @@
!python {model: hr.payslip}: |
from tools.translate import _
payslip_brw=self.browse(cr, uid, ref("hr_payslip_0"))
- assert(payslip_brw.state == 'done'), _('State not changed!')
\ No newline at end of file
+ assert(payslip_brw.state == 'done'), _('State not changed!')
=== modified file 'hr_recruitment/test/test_hr_recruitment.yml'
--- hr_recruitment/test/test_hr_recruitment.yml 2011-04-07 09:27:30 +0000
+++ hr_recruitment/test/test_hr_recruitment.yml 2011-08-12 09:38:22 +0000
@@ -107,4 +107,57 @@
I check that applicant state is "Hired".
-
!assert {model: hr.applicant, id: hr_applicant_fresher0}:
- - state == 'done'
+ - state == 'done'
+-
+ I check _get_stage of hr applicant
+-
+ !python {model: hr.applicant}: |
+ self._get_stage(cr, uid, context=None)
+-
+ I check onchange_department_id of hr applicant
+-
+ !python {model: hr.applicant}: |
+ self.onchange_department_id(cr, uid, [ref('hr_applicant_fresher0')], department_id=False, context=None)
+-
+ I check stage_previous of hr applicant
+-
+ !python {model: hr.applicant}: |
+ self.stage_previous(cr, uid, [ref('hr_applicant_fresher0')], context=None)
+-
+ I check stage_next of hr applicant
+-
+ !python {model: hr.applicant}: |
+ self.stage_next(cr, uid, [ref('hr_applicant_fresher0')], context=None)
+-
+ I check action_print_survey of hr applicant
+-
+ !python {model: hr.applicant}: |
+ self.action_print_survey(cr, uid, [ref('hr_applicant_fresher0')], context=None)
+-
+ I check _get_note of hr recruitment job2phonecall wizard.
+-
+ !python {model: hr.recruitment.job2phonecall}: |
+ self._get_note(cr, uid, context={'lang': 'en_US', 'search_default_department_id': False, 'tz': False, 'active_model': 'hr.recruitment.job2phonecall', 'department_id': False, 'section_id': False, 'search_default_user_id': ref('hr_applicant_fresher0'), 'search_default_current': 1, 'active_ids': [ref('hr_applicant_fresher0')], 'active_id': ref('hr_applicant_fresher0')})
+-
+ I check case_close of hr recruitment hired employee.
+-
+ !python {model: hired.employee}: |
+ self.case_close(cr, uid, [ref('hr_applicant_fresher0')][0], context={'lang': u'en_US', 'search_default_department_id': False, 'tz': False, 'active_model': 'hired.employee', 'department_id': False, 'section_id': False, 'search_default_user_id': 1, 'search_default_current': ref('hr_applicant_fresher0'), 'active_ids': [ref('hr_applicant_fresher0')], 'active_id': 81L})
+-
+ I check case_close_with_emp of hr recruitment hired employee.
+-
+ !python {model: hired.employee}: |
+ self.case_close_with_emp(cr, uid, [ref('hr_applicant_fresher0')][0], context={'lang': u'en_US', 'search_default_department_id': False, 'tz': False, 'active_model': 'hired.employee', 'department_id': False, 'section_id': False, 'search_default_user_id': 1, 'search_default_current': ref('hr_applicant_fresher0'), 'active_ids': [ref('hr_applicant_fresher0')], 'active_id': 81L})
+
+-
+ I create an entry for the hr recruitment partner create.
+-
+ !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_create0}:
+ close: False
+-
+ I check make_order of hr recruitment partner create.
+-
+ !python {model: hr.recruitment.partner.create}: |
+ self.make_order(cr, uid, [ref('hr_recruitment_partner_create0')], context={'lang': 'en_US', 'search_default_department_id': False, 'tz': False, 'active_model': 'hr.recruitment.partner.create', 'department_id': False, 'section_id': False, 'search_default_user_id': ref('hr_recruitment_partner_create0'), 'search_default_current': 1, 'active_ids': [ref('hr_recruitment_partner_create0')], 'active_id': ref('hr_recruitment_partner_create0')}
+ )
+
\ No newline at end of file
=== modified file 'hr_timesheet/test/test_hr_timesheet.yml'
--- hr_timesheet/test/test_hr_timesheet.yml 2011-07-12 12:07:48 +0000
+++ hr_timesheet/test/test_hr_timesheet.yml 2011-08-12 09:38:22 +0000
@@ -136,3 +136,14 @@
- |
I can see employee timesheet for particular month using "Employee Timesheet" report.
+-
+ I Check _getGeneralAccount hr analytic timesheet.
+-
+ !python {model: hr.analytic.timesheet}: |
+ self._getGeneralAccount(cr, uid, context=None)
+-
+ I Check _getAnalyticJournal hr analytic timesheet.
+-
+ !python {model: hr.analytic.timesheet}: |
+ self._getAnalyticJournal(cr, uid, context=None)
+
\ No newline at end of file
=== modified file 'hr_timesheet/wizard/hr_timesheet_print_employee.py'
--- hr_timesheet/wizard/hr_timesheet_print_employee.py 2011-03-14 10:27:42 +0000
+++ hr_timesheet/wizard/hr_timesheet_print_employee.py 2011-08-12 09:38:22 +0000
@@ -35,7 +35,7 @@
}
def _get_user(self, cr, uid, context=None):
-
+
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
if not emp_id:
=== modified file 'hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml'
--- hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2011-05-03 13:00:24 +0000
+++ hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml 2011-08-12 09:38:22 +0000
@@ -82,3 +82,8 @@
I can also make some theoretical revenue reports.
-
I can also see timesheet profit using Timesheet profit report.
+-
+ I check on_change_account_id to create Invoice.
+-
+ !python {model: hr.analytic.timesheet}: |
+ self.on_change_account_id(cr, uid, [ref("hr_timesheet_invoice_create_0")], account_id=1)
=== modified file 'hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml'
--- hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml 2011-07-18 11:03:50 +0000
+++ hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml 2011-08-12 09:38:22 +0000
@@ -162,3 +162,68 @@
!assert {model: hr_timesheet_sheet.sheet, id: hr_timesheet_sheet_sheet_deddk0}:
- state == 'done'
+-
+ I check _total_day.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self._total_day(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], name='test', args={}, context=None)
+-
+ I check _state_attendance.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self._state_attendance(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], name='test', args={}, context=None)
+-
+ I check date_today.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.date_today(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], context=None)
+-
+ I check date_previous.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.date_previous(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], context=None)
+-
+ I check date_next.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.date_next(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], context=None)
+-
+ I check button dummy.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.button_dummy(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], context=None)
+-
+ I check _default_date_from.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self._default_date_from(cr, uid, context=None)
+-
+ I check _default_employee.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self._default_employee(cr, uid, context=None)
+-
+ I check action_set_to_draft.
+-
+ !python {model: hr_timesheet_sheet.sheet}: |
+ self.action_set_to_draft(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')])
+-
+ I check _get_default_date.
+-
+ !python {model: hr.analytic.timesheet}: |
+ self._get_default_date(cr, uid, context=None)
+-
+ I check _get_default_date.
+-
+ !python {model: hr.attendance}: |
+ self._get_default_date(cr, uid, context=None)
+-
+ I check _check.
+-
+ !python {model: hr.attendance}: |
+ self._check(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')])
+-
+ I check open_timesheet.
+-
+ !python {model: hr.timesheet.current.open}: |
+ self.open_timesheet(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')],context=None)
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp