def test_addHoliday_should_create_the_item(self): # add a "holiday" item to the Timesheet of an employee year = 2015 month = 10 day = 3 when = date(year, month, day) employee = Employee("a", "b") timesheet = Timesheet(2015, 10, employee) timesheet.addHoliday(when) self.assertIsNotNone(timesheet.items) self.assertEqual(len(timesheet.items), 1)
def test_create_from_data(self): year = 2015 month = 9 firstName = "John" lastName = "Doe" employee = Employee(firstName, lastName) data = { "year": year, "month": month, "employee": employee, } timesheet = Timesheet.create_from_data(data) self.assertIsNotNone(timesheet)