Пример #1
0
 def test_advanced_components_munge_tabs(self):
     """
     Test that adding and removing specific advanced components adds and removes tabs.
     """
     self.assertNotIn(EXTRA_TAB_PANELS.get("open_ended"), self.course.tabs)
     self.assertNotIn(EXTRA_TAB_PANELS.get("notes"), self.course.tabs)
     self.client.ajax_post(self.course_setting_url, {ADVANCED_COMPONENT_POLICY_KEY: ["combinedopenended"]})
     course = modulestore().get_item(self.course_location)
     self.assertIn(EXTRA_TAB_PANELS.get("open_ended"), course.tabs)
     self.assertNotIn(EXTRA_TAB_PANELS.get("notes"), course.tabs)
     self.client.ajax_post(self.course_setting_url, {ADVANCED_COMPONENT_POLICY_KEY: []})
     course = modulestore().get_item(self.course_location)
     self.assertNotIn(EXTRA_TAB_PANELS.get("open_ended"), course.tabs)
 def test_course_settings_munge_tabs(self):
     """
     Test that adding and removing specific course settings adds and removes tabs.
     """
     self.assertNotIn(EXTRA_TAB_PANELS.get("edxnotes"), self.course.tabs)
     self.client.ajax_post(self.course_setting_url, {
         "edxnotes": {"value": True}
     })
     course = modulestore().get_course(self.course.id)
     self.assertIn(EXTRA_TAB_PANELS.get("edxnotes"), course.tabs)
     self.client.ajax_post(self.course_setting_url, {
         "edxnotes": {"value": False}
     })
     course = modulestore().get_course(self.course.id)
     self.assertNotIn(EXTRA_TAB_PANELS.get("edxnotes"), course.tabs)
Пример #3
0
 def test_course_settings_munge_tabs(self):
     """
     Test that adding and removing specific course settings adds and removes tabs.
     """
     self.assertNotIn(EXTRA_TAB_PANELS.get("edxnotes"), self.course.tabs)
     self.client.ajax_post(self.course_setting_url, {
         "edxnotes": {"value": True}
     })
     course = modulestore().get_course(self.course.id)
     self.assertIn(EXTRA_TAB_PANELS.get("edxnotes"), course.tabs)
     self.client.ajax_post(self.course_setting_url, {
         "edxnotes": {"value": False}
     })
     course = modulestore().get_course(self.course.id)
     self.assertNotIn(EXTRA_TAB_PANELS.get("edxnotes"), course.tabs)
Пример #4
0
 def test_advanced_components_munge_tabs(self):
     """
     Test that adding and removing specific advanced components adds and removes tabs.
     """
     self.assertNotIn(EXTRA_TAB_PANELS.get("open_ended"), self.course.tabs)
     self.assertNotIn(EXTRA_TAB_PANELS.get("notes"), self.course.tabs)
     self.client.ajax_post(
         self.course_setting_url,
         {ADVANCED_COMPONENT_POLICY_KEY: ["combinedopenended"]})
     course = modulestore().get_item(self.course_location)
     self.assertIn(EXTRA_TAB_PANELS.get("open_ended"), course.tabs)
     self.assertNotIn(EXTRA_TAB_PANELS.get("notes"), course.tabs)
     self.client.ajax_post(self.course_setting_url,
                           {ADVANCED_COMPONENT_POLICY_KEY: []})
     course = modulestore().get_item(self.course_location)
     self.assertNotIn(EXTRA_TAB_PANELS.get("open_ended"), course.tabs)