[IMP] hr_attendance: improve yml test cases

bzr revid: jap@tinyerp.com-20111208102404-kiopq8q3g3x1212o
This commit is contained in:
Jagdish Panchal (Open ERP) 2011-12-08 15:54:04 +05:30
parent cbaa56a274
commit 22c4f560b3
1 changed files with 6 additions and 28 deletions

View File

@ -1,27 +1,5 @@
-
In order to test attendance process in OpenERP, At the time of login, I create an attendance with sign in action.
-
!record {model: hr.attendance, id: hr_attendance_0}:
action: sign_in
employee_id: 'hr.employee3'
name: !eval "'%s-01-01 19:08:08' %(datetime.now().year)"
-
I check that Employee is "Present".
-
!assert {model: hr.employee, id: hr.employee3}:
- state == 'present'
-
At the time of logout, I create an attendance with "Sign Out" action.
-
!record {model: hr.attendance, id: hr_attendance_1}:
action: sign_out
employee_id: 'hr.employee3'
name: !eval "'%s-01-01 19:10:55' %(datetime.now().year)"
-
I check that Employee is Absent.
-
!assert {model: hr.employee, id: hr.employee3}:
- state == 'absent'
In order to test attendance process in OpenERP, At the time of login,
-
I will use "Sign In/Sign Out" wizard for attendances.
-
@ -41,7 +19,7 @@
-
I check that Employee is "Present".
-
!assert {model: hr.employee, id: hr.employee3}:
!assert {model: hr.employee, id: hr.employee3, severity: error, string: Employee should be in present state}:
- state == 'present'
-
I click on "Sign In" button of this wizard, this will Open a new form which ask for Last Sign Out date.
@ -56,20 +34,20 @@
-
I select Last Sign Out date.
-
!record {model: hr.sign.in.out.ask, id: hr_sign_in_out_ask_Antoine Philippe}:
!record {model: hr.sign.in.out.ask, id: hr_sign_in_out_ask_Antoine_Philippe}:
last_time: !eval time.strftime('%Y-%m-%d %H:%M:%S')
name: Antoine Philippe
-
Now I check employee is sing in.
Now I click on "Sign In" button of this wizard.
-
!python {model: hr.sign.in.out.ask}: |
obj_attendance = self.pool.get('hr.employee')
emp_id = obj_attendance.search(cr, uid, [('user_id', '=', uid), ('name', '=', "Antoine Philippe")])
if emp_id:
employee = obj_attendance.read(cr, uid, emp_id)[0]
self.write(cr, uid, [ref('hr_sign_in_out_ask_Antoine Philippe')], {'emp_id': emp_id[0]})
self.write(cr, uid, [ref('hr_sign_in_out_ask_Antoine_Philippe')], {'emp_id': emp_id[0]})
-
Finally i check the employee is present.
-
!assert {model: hr.employee, id: hr.employee3}:
!assert {model: hr.employee, id: hr.employee3, severity: error, string: Employee should be in present state}:
- state == 'present'