def test_get_date(self): """ Assert that get_date returns valid date. """ ccx = self.make_ccx() for section in self.course.get_children(): self.assertEqual(get_date(ccx, section, 'start'), self.mooc_start) self.assertEqual(get_date(ccx, section, 'due'), None) for subsection in section.get_children(): self.assertEqual(get_date(ccx, subsection, 'start'), self.mooc_start) self.assertEqual(get_date(ccx, subsection, 'due'), self.mooc_due) for unit in subsection.get_children(): self.assertEqual(get_date(ccx, unit, 'start', parent_node=subsection), self.mooc_start) self.assertEqual(get_date(ccx, unit, 'due', parent_node=subsection), self.mooc_due)