-
  In order to test attendance process in OpenERP, I entry of SignIn of employee.
-
  !python {model: hr.employee}: |
    self.attendance_action_change(cr, uid, [ref("hr.employee_al")], context=context)
-
  I check that Employee is "Present".
-
  !assert {model: hr.employee, id: hr.employee_al, severity: error, string: Employee should be in present state}:
    - state == 'present'
-
  After few seconds, employee sign's out.
-
  !python {model: hr.employee}: |
    import time
    time.sleep(2)
    self.attendance_action_change(cr, uid, [ref("hr.employee_al")], context=context)
-
  I check that Employee is "Absent".
-
  !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}: |
    import time
    try:
      self.create(cr, uid, {'employee_id': ref('hr.employee_niv'), 'name': time.strftime('%Y-%m-%d 09:59:25'), 'action': 'sign_out'}, None)
    except Exception, e:
      assert e[0]=='ValidateError', e
-
  First of all, Employee Sign's In.
-
  !record {model: hr.attendance, id: hr_attendance_0}:
    employee_id: hr.employee_niv
    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}: |
     import time
     try:
       self.create(cr, uid, {'employee_id': ref('hr.employee_niv'), 'name': time.strftime('%Y-%m-%d 08:59:25'), 'action': 'sign_in'}, None)
     except Exception, e:
       assert e[0]=='ValidateError', e
-
  After that Employee is going to Sign In after First Sign In.
-
   !python {model: hr.attendance}: |
     import time
     try:
       self.create(cr, uid, {'employee_id': ref('hr.employee_niv'), 'name': time.strftime('%Y-%m-%d 10:59:25'), 'action': 'sign_in'}, None)
     except Exception, e:
       assert e[0]=='ValidateError', e
-
  After two hours, Employee Sign's Out.
-
  !record {model: hr.attendance, id: hr_attendance_1}:
    employee_id: hr.employee_niv
    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}: |
     import time
     try:
       self.create(cr, uid, {'employee_id': ref('hr.employee_niv'), 'name': time.strftime('%Y-%m-%d 10:59:25'), 'action': 'sign_out'}, None)
     except Exception, e:
       assert e[0]=='ValidateError', e
-
  After that Employee is going to Sign Out After First Sign Out.
-
   !python {model: hr.attendance}: |
     import time
     try:
       self.create(cr, uid, {'employee_id': ref('hr.employee_niv'), 'name': time.strftime('%Y-%m-%d 12:59:25'), 'action': 'sign_out'}, None)
     except Exception, e:
       assert e[0]=='ValidateError', e
