summaryrefslogtreecommitdiff
path: root/test/templates
diff options
context:
space:
mode:
Diffstat (limited to 'test/templates')
-rw-r--r--test/templates/test_ceo_template.py10
-rw-r--r--test/templates/test_employee_status_template.py26
-rw-r--r--test/templates/test_manager_template.py15
3 files changed, 20 insertions, 31 deletions
diff --git a/test/templates/test_ceo_template.py b/test/templates/test_ceo_template.py
index 6962a20..4bf37d0 100644
--- a/test/templates/test_ceo_template.py
+++ b/test/templates/test_ceo_template.py
@@ -10,10 +10,8 @@ class CEOEmailTemplateTest(unittest.TestCase):
def test_ceo_email(self):
result = self.template.build(timesheets=[self.not_approved, self.not_submitted])
- self.assertIn("Markus Krogh (MKR)", result)
- self.assertIn("Markus Krogh (MK)", result)
- self.assertIn("has not been approved by JK", result)
- self.assertIn("has not been approved by JKL", result)
- self.assertIn("has been submitted", result)
- self.assertIn("has not been submitted", result)
+ self.assertIn("[Not approved] Markus Krogh (MK)", result)
+ self.assertIn("JK", result)
+ self.assertIn("[Unsubmitted] Markus Krogh (MKR)", result)
+ self.assertIn("JKL", result)
diff --git a/test/templates/test_employee_status_template.py b/test/templates/test_employee_status_template.py
index 0d37d3e..9869b81 100644
--- a/test/templates/test_employee_status_template.py
+++ b/test/templates/test_employee_status_template.py
@@ -1,25 +1,23 @@
-from maconomy import EmployeeStatusTemplate, Employee, Timesheet
+from maconomy import EmployeeStatusListTemplate, Employee, Timesheet
import unittest
-class EmployeeStatusTemplateTest(unittest.TestCase):
+class EmployeeStatusListTemplateTest(unittest.TestCase):
def setUp(self):
- self.template = EmployeeStatusTemplate()
+ self.template = EmployeeStatusListTemplate()
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)
+ timesheets = [Timesheet("11", 0, 0, self.employee, "JK")]
+ result = self.template.build(timesheets)
+ self.assertIn("[Unsubmitted] Markus Krogh (MK)", 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)
+ timesheets = [Timesheet("11", submitted=1, approved=0, employee=self.employee, approver="JK")]
+ result = self.template.build(timesheets)
+ self.assertIn("[Not approved] Markus Krogh (MK)", 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)
+ timesheets = [Timesheet("11", submitted=1, approved=1, employee=self.employee, approver="JK")]
+ result = self.template.build(timesheets)
+ self.assertIn("[OK] Markus Krogh (MK)", result)
diff --git a/test/templates/test_manager_template.py b/test/templates/test_manager_template.py
index bdc7387..d650eb9 100644
--- a/test/templates/test_manager_template.py
+++ b/test/templates/test_manager_template.py
@@ -11,18 +11,14 @@ class ManagerEmailTemplateTest(unittest.TestCase):
result = self.template.build(
timesheets=[self.not_approved],
maconomyurl="http://localhost/")
- self.assertIn("Markus Krogh (MK)", result)
- self.assertIn("has not been approved", result)
- self.assertIn("has been submitted", result)
+ self.assertIn("[Not approved] Markus Krogh (MK)", result)
self.assertIn("href=\"http://localhost/\"", result)
def test_not_submitted(self):
result = self.template.build(
timesheets=[self.not_submitted],
maconomyurl="http://localhost/")
- self.assertIn("Markus Krogh (MKR)", result)
- self.assertIn("has not been approved", result)
- self.assertIn("has not been submitted", result)
+ self.assertIn("[Unsubmitted] Markus Krogh (MKR)", result)
self.assertIn("href=\"http://localhost/\"", result)
def test_multiple_timesheets(self):
@@ -30,10 +26,7 @@ class ManagerEmailTemplateTest(unittest.TestCase):
timesheets=[self.not_submitted, self.not_approved],
maconomyurl="http://localhost/")
- self.assertIn("Markus Krogh (MKR)", result)
- self.assertIn("Markus Krogh (MK)", result)
- self.assertIn("has not been approved", result)
- self.assertIn("has been submitted", result)
- self.assertIn("has not been submitted", result)
+ self.assertIn("[Unsubmitted] Markus Krogh (MKR)", result)
+ self.assertIn("[Not approved] Markus Krogh (MK)", result)
self.assertIn("href=\"http://localhost/\"", result)