[IMP] hr_attendance: Cleanup the test case
bzr revid: jap@tinyerp.com-20111226100246-6607vffwz79fvs2d
This commit is contained in:
parent
f91048c40b
commit
72c8134491
|
@ -2,7 +2,7 @@
|
|||
In order to test attendance process in OpenERP, I perform SignIn/SignOut for an employee.
|
||||
-
|
||||
!record {model: hr.sign.in.out, id: employee_sign_in}:
|
||||
emp_id: hr.employee3
|
||||
emp_id: hr.employee_mit
|
||||
state: absent
|
||||
-
|
||||
Employee Signs In.
|
||||
|
@ -10,23 +10,23 @@
|
|||
!python {model: hr.sign.in.out}: |
|
||||
import time
|
||||
from datetime import datetime, date, timedelta
|
||||
employee = self.pool.get('hr.employee').read(cr, uid, ref('hr.employee3'))
|
||||
employee = self.pool.get('hr.employee').read(cr, uid, ref('hr.employee_mit'))
|
||||
self.write(cr, uid, [ref('employee_sign_in')], {'name': employee['name'], 'state': employee['state'], 'emp_id': employee['id']})
|
||||
self.si_check(cr, uid, [ref("employee_sign_in")])
|
||||
-
|
||||
I check that Employee is "Present".
|
||||
-
|
||||
!assert {model: hr.employee, id: hr.employee_al, severity: error, string: Employee should be in present state}:
|
||||
!assert {model: hr.employee, id: hr.employee_mit, severity: error, string: Employee should be in present state}:
|
||||
- state == 'present'
|
||||
-
|
||||
After few seconds, employee sign's out.
|
||||
-
|
||||
!python {model: hr.sign.in.out.ask}: |
|
||||
!python {model: hr.sign.in.out}: |
|
||||
import time
|
||||
time.sleep(2)
|
||||
self.so_check(cr, uid, [ref("employee_sign_in")])
|
||||
-
|
||||
I check that Employee is "Absent".
|
||||
-
|
||||
!assert {model: hr.employee, id: hr.employee3, severity: error, string: Employee should be in absent state}:
|
||||
!assert {model: hr.employee, id: hr.employee_mit, severity: error, string: Employee should be in absent state}:
|
||||
- state == 'absent'
|
Loading…
Reference in New Issue