def test_get_module_context_chapter(self): """ Tests `get_module_context` method for the chapters. """ self.assertDictEqual( { u"display_name": self.chapter.display_name_with_default, u"index": 0, u"location": unicode(self.chapter.location), u"children": [unicode(self.sequential.location)], }, helpers.get_module_context(self.course, self.chapter)) self.assertDictEqual( { u"display_name": self.chapter_2.display_name_with_default, u"index": 1, u"location": unicode(self.chapter_2.location), u"children": [], }, helpers.get_module_context(self.course, self.chapter_2))
def test_get_module_context_html_component(self): """ Tests `get_module_context` method for the components. """ self.assertDictEqual( { u"display_name": self.html_module_1.display_name_with_default, u"location": unicode(self.html_module_1.location), }, helpers.get_module_context(self.course, self.html_module_1))
def test_get_module_context_html_component(self): """ Tests `get_module_context` method for the components. """ self.assertDictEqual( { u"display_name": self.html_module_1.display_name_with_default_escaped, u"location": unicode(self.html_module_1.location), }, helpers.get_module_context(self.course, self.html_module_1) )
def test_get_module_context_sequential(self): """ Tests `get_module_context` method for the sequential. """ self.assertDictEqual( { u"display_name": self.sequential.display_name_with_default_escaped, u"location": unicode(self.sequential.location), u"children": [unicode(self.vertical.location), unicode(self.vertical_with_container.location)], }, helpers.get_module_context(self.course, self.sequential) )
def test_get_module_context_chapter(self): """ Tests `get_module_context` method for the chapters. """ self.assertDictEqual( { u"display_name": self.chapter.display_name_with_default_escaped, u"index": 0, u"location": unicode(self.chapter.location), u"children": [unicode(self.sequential.location)], }, helpers.get_module_context(self.course, self.chapter) ) self.assertDictEqual( { u"display_name": self.chapter_2.display_name_with_default_escaped, u"index": 1, u"location": unicode(self.chapter_2.location), u"children": [], }, helpers.get_module_context(self.course, self.chapter_2) )