diff options
author | Markus Krogh <markus@nordu.net> | 2016-03-10 11:53:42 +0000 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2016-03-10 11:53:42 +0000 |
commit | 4575c7ea47680e7f589477c917a73353d6faef73 (patch) | |
tree | 5f1fb1d8d120b8d609b2018a5eb8e8ad30183952 /test/templates/test_employee_status_template.py | |
parent | 67abade3147d6d706c18beaac219d549fb71c35e (diff) |
Manager mail + ceo mail
Diffstat (limited to 'test/templates/test_employee_status_template.py')
-rw-r--r-- | test/templates/test_employee_status_template.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/templates/test_employee_status_template.py b/test/templates/test_employee_status_template.py new file mode 100644 index 0000000..0d37d3e --- /dev/null +++ b/test/templates/test_employee_status_template.py @@ -0,0 +1,25 @@ +from maconomy import EmployeeStatusTemplate, Employee, Timesheet +import unittest + +class EmployeeStatusTemplateTest(unittest.TestCase): + + def setUp(self): + self.template = EmployeeStatusTemplate() + self.employee = Employee.from_result(("MK", "Markus Krogh", "markus@nordu.net")) + + def test_substitute(self): + timesheet = Timesheet("11", 0, 0, self.employee, "JK") + result = self.template.build(timesheet) + self.assertIn("Markus Krogh (MK)", result) + self.assertIn("not been submitted", result) + self.assertIn("not been approved", result) + + def test_submitted(self): + timesheet = Timesheet("11", submitted=1, approved=0, employee=self.employee, approver="JK") + result = self.template.build(timesheet) + self.assertIn("has been submitted", result) + + def test_approved(self): + timesheet = Timesheet("11", submitted=1, approved=1, employee=self.employee, approver="JK") + result = self.template.build(timesheet) + self.assertIn("has been approved", result) |