Example #1
0
 def test_register_employee_without_balance_vacation(self):
     employee = EmployeeProvider.create_simple("Some Name", "some_password", "*****@*****.**")
     now_date = datetime.now()
     employee = EmployeeProvider.register(employee=employee,
                                          employment_date=now_date)
     self.assertIsNotNone(employee)
     self.assertEqual(employee.registration_date.year, now_date.year)
     self.assertEqual(employee.registration_date.month, now_date.month)
     self.assertEqual(employee.registration_date.day, now_date.day)
     self.assertEqual(employee.employment_date, now_date)
     self.assertEqual(employee.vacation, 0)
Example #2
0
 def test_register_employee_without_balance_vacation(self):
     serialized_employee = fixtures.load("unaccepted_user")
     employee = EmployeeProvider.deserialize(serialized_employee)
     now_date = datetime.now()
     employee = EmployeeProvider.register(employee=employee,
                                          employment_date=now_date)
     self.assertIsNotNone(employee)
     self.assertEqual(employee.acceptance_date.year, now_date.year)
     self.assertEqual(employee.acceptance_date.month, now_date.month)
     self.assertEqual(employee.acceptance_date.day, now_date.day)
     self.assertEqual(employee.employment_date, now_date)
     self.assertEqual(employee.activated, True)
     self.assertEqual(employee.is_admin, False)
     self.assertEqual(employee.vacation, 0)
Example #3
0
 def test_register_employee(self):
     employee = fixtures.load_instance("unaccepted_user", Employee)
     now_date = datetime.now()
     employee = EmployeeProvider.register(employee=employee,
                                          employment_date=now_date,
                                          balance_vac=5)
     self.assertIsNotNone(employee)
     self.assertEqual(employee.acceptance_date.year, now_date.year)
     self.assertEqual(employee.acceptance_date.month, now_date.month)
     self.assertEqual(employee.acceptance_date.day, now_date.day)
     self.assertEqual(employee.employment_date, now_date)
     self.assertEqual(employee.activated, True)
     self.assertEqual(employee.is_admin, False)
     self.assertEqual(employee.vacation, 5)