diff options
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) |