Merge pull request #2704 from edx/adam/refactor-static-tab-tests
refactor static tab tests
This commit is contained in:
@@ -19,10 +19,6 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
category="about", parent_location=self.course.location,
|
||||
data="OOGIE BLOOGIE", display_name="overview"
|
||||
)
|
||||
# The following XML course is closed; we're testing that
|
||||
# an about page still appears when the course is already closed
|
||||
self.xml_course_id = 'edX/detached_pages/2014'
|
||||
self.xml_data = "about page 463139"
|
||||
|
||||
def test_logged_in(self):
|
||||
self.setup_user()
|
||||
@@ -37,6 +33,18 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertIn("OOGIE BLOOGIE", resp.content)
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
|
||||
class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
# The following XML test course (which lives at common/test/data/2014)
|
||||
# is closed; we're testing that an about page still appears when
|
||||
# the course is already closed
|
||||
xml_course_id = 'edX/detached_pages/2014'
|
||||
|
||||
# this text appears in that course's about page
|
||||
# common/test/data/2014/about/overview.html
|
||||
xml_data = "about page 463139"
|
||||
|
||||
@mock.patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False})
|
||||
def test_logged_in_xml(self):
|
||||
self.setup_user()
|
||||
@@ -68,10 +76,6 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, ModuleStoreTes
|
||||
category="about", parent_location=self.course.location,
|
||||
data="OOGIE BLOOGIE", display_name="overview"
|
||||
)
|
||||
# The following XML course is closed; we're testing that
|
||||
# an about page still appears when the course is already closed
|
||||
self.xml_course_id = 'edX/detached_pages/2014'
|
||||
self.xml_data = "about page 463139"
|
||||
|
||||
def test_enrollment_cap(self):
|
||||
"""
|
||||
|
||||
@@ -19,10 +19,6 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
category="course_info", parent_location=self.course.location,
|
||||
data="OOGIE BLOOGIE", display_name="updates"
|
||||
)
|
||||
# The following XML course is closed; we're testing that
|
||||
# a course info page still appears when the course is already closed
|
||||
self.xml_data = "course info 463139"
|
||||
self.xml_course_id = "edX/detached_pages/2014"
|
||||
|
||||
def test_logged_in(self):
|
||||
self.setup_user()
|
||||
@@ -37,6 +33,18 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertNotIn("OOGIE BLOOGIE", resp.content)
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
|
||||
class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
# The following XML test course (which lives at common/test/data/2014)
|
||||
# is closed; we're testing that a course info page still appears when
|
||||
# the course is already closed
|
||||
xml_course_id = 'edX/detached_pages/2014'
|
||||
|
||||
# this text appears in that course's course info page
|
||||
# common/test/data/2014/info/updates.html
|
||||
xml_data = "course info 463139"
|
||||
|
||||
@mock.patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False})
|
||||
def test_logged_in_xml(self):
|
||||
self.setup_user()
|
||||
|
||||
@@ -155,11 +155,6 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
category="static_tab", parent_location=self.course.location,
|
||||
data="OOGIE BLOOGIE", display_name="new_tab"
|
||||
)
|
||||
# The following XML course is closed; we're testing that
|
||||
# static tabs still appear when the course is already closed
|
||||
self.xml_data = "static 463139"
|
||||
self.xml_url = "8e4cce2b4aaf4ba28b1220804619e41f"
|
||||
self.xml_course_id = 'edX/detached_pages/2014'
|
||||
|
||||
def test_logged_in(self):
|
||||
self.setup_user()
|
||||
@@ -174,6 +169,19 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertIn("OOGIE BLOOGIE", resp.content)
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
|
||||
class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
# The following XML test course (which lives at common/test/data/2014)
|
||||
# is closed; we're testing that tabs still appear when
|
||||
# the course is already closed
|
||||
xml_course_id = 'edX/detached_pages/2014'
|
||||
|
||||
# this text appears in the test course's tab
|
||||
# common/test/data/2014/tabs/8e4cce2b4aaf4ba28b1220804619e41f.html
|
||||
xml_data = "static 463139"
|
||||
xml_url = "8e4cce2b4aaf4ba28b1220804619e41f"
|
||||
|
||||
@patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False})
|
||||
def test_logged_in_xml(self):
|
||||
self.setup_user()
|
||||
|
||||
Reference in New Issue
Block a user