[ADD] hr_attendance : Added Test Cases For Hr Attendance

bzr revid: mdi@tinyerp.com-20120112094904-b10x1mx4c2uxitzj
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-01-12 15:19:04 +05:30
parent 20ed63d598
commit 59cbdd3341
1 changed files with 54 additions and 1 deletions

View File

@ -28,4 +28,57 @@
-
!assert {model: hr.employee, id: hr.employee_al, severity: error, string: Employee should be in absent state}:
- state == 'absent'
-
In order to check that first attendance must be Sign In.
-
!python {model: hr.attendance}: |
try:
self.create(cr, uid, {employee_id: hr.employee_fp, name: time.strftime('%Y-%m-%d 09:59:25'), action: 'sign_out'}, None)
except Exception, e:
assert e, 'The first attendance must be Sign In'
-
First of all, Employee Sign's In.
-
!record {model: hr.attendance, id: hr_attendance_1}:
employee_id: hr.employee_fp
name: !eval time.strftime('%Y-%m-%d 09:59:25')
action: 'sign_in'
-
Now Employee is going to Sign In prior to First Sign In.
-
!python {model: hr.attendance}: |
try:
self.create(cr, uid, {employee_id: hr.employee_fp, name: time.strftime('%Y-%m-%d 08:59:25'), action: 'sign_in'}, None)
except Exception, e:
assert e, 'Sign In (resp. Sign Out) must follow Sign Out (resp. Sign In)'
-
After that Employee is going to Sign In after First Sign In.
-
!python {model: hr.attendance}: |
try:
self.create(cr, uid, {employee_id: hr.employee_fp, name: time.strftime('%Y-%m-%d 10:59:25'), action: 'sign_in'}, None)
except Exception, e:
assert e, 'Sign In (resp. Sign Out) must follow Sign Out (resp. Sign In)'
-
After two hours, Employee Sign's Out.
-
!record {model: hr.attendance, id: hr_attendance_4}:
employee_id: hr.employee_fp
name: !eval time.strftime('%Y-%m-%d 11:59:25')
action: 'sign_out'
-
Now Employee is going to Sign Out prior to First Sign Out.
-
!python {model: hr.attendance}: |
try:
self.create(cr, uid, {employee_id: hr.employee_fp, name: time.strftime('%Y-%m-%d 10:59:25'), action: 'sign_out'}, None)
except Exception, e:
assert e, 'Sign In (resp. Sign Out) must follow Sign Out (resp. Sign In)'
-
After that Employee is going to Sign Out After First Sign Out.
-
!python {model: hr.attendance}: |
try:
self.create(cr, uid, {employee_id: hr.employee_fp, name: time.strftime('%Y-%m-%d 12:59:25'), action: 'sign_out'}, None)
except Exception, e:
assert e, 'Sign In (resp. Sign Out) must follow Sign Out (resp. Sign In)'