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/views/test_employee_email.py | |
parent | 67abade3147d6d706c18beaac219d549fb71c35e (diff) |
Manager mail + ceo mail
Diffstat (limited to 'test/views/test_employee_email.py')
-rw-r--r-- | test/views/test_employee_email.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/views/test_employee_email.py b/test/views/test_employee_email.py new file mode 100644 index 0000000..75ebbd6 --- /dev/null +++ b/test/views/test_employee_email.py @@ -0,0 +1,25 @@ +from maconomy import EmployeeEmailView, Timesheet +from ConfigParser import SafeConfigParser +import unittest + +class EmployeeEmailViewTest(unittest.TestCase): + def setUp(self): + self.config = SafeConfigParser() + self.config.add_section("view") + self.config.set("view", "maconomyurl", "http://localhost/maconomy") + self.config.set("view", "helpurl", "http://localhost/help") + self.view = EmployeeEmailView(self.config) + self.timesheet = Timesheet.from_result(("Markus Krogh", "MK", "markus@nordu.net", 11, 0, 0, "JK")) + + def test_missing_timereg(self): + self.timesheet.submitted=None + result = self.view.render(self.timesheet) + self.assertIn("href=\"http://localhost/maconomy\"", result) + self.assertIn("href=\"http://localhost/help\"", result) + + def test_unsubmitted_timereg(self): + self.timesheet.submitted=0 + result = self.view.render(self.timesheet) + self.assertIn("week 11", result) + self.assertIn("href=\"http://localhost/maconomy\"", result) + self.assertIn("href=\"http://localhost/help\"", result) |