Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions lms/djangoapps/courseware/tests/test_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ def setUp(self):
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()
Expand All @@ -37,6 +33,18 @@ def test_anonymous_user(self):
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()
Expand Down Expand Up @@ -68,10 +76,6 @@ def setUp(self):
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):
"""
Expand Down
16 changes: 12 additions & 4 deletions lms/djangoapps/courseware/tests/test_course_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ def setUp(self):
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()
Expand All @@ -37,6 +33,18 @@ def test_anonymous_user(self):
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()
Expand Down
18 changes: 13 additions & 5 deletions lms/djangoapps/courseware/tests/test_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ def setUp(self):
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()
Expand All @@ -174,6 +169,19 @@ def test_anonymous_user(self):
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()
Expand Down