Refactored out full from the lms tests
This commit is contained in:
@@ -6,6 +6,7 @@ import xmodule.modulestore.django
|
||||
from courseware.tests.tests import LoginEnrollmentTestCase, TEST_DATA_XML_MODULESTORE
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_XML_MODULESTORE)
|
||||
class WikiRedirectTestCase(LoginEnrollmentTestCase):
|
||||
def setUp(self):
|
||||
@@ -16,7 +17,6 @@ class WikiRedirectTestCase(LoginEnrollmentTestCase):
|
||||
"""Assumes the course is present"""
|
||||
return [c for c in courses if c.location.course == name][0]
|
||||
|
||||
self.full = find_course("full")
|
||||
self.toy = find_course("toy")
|
||||
|
||||
# Create two accounts
|
||||
|
||||
@@ -142,7 +142,7 @@ class TestTOC(TestCase):
|
||||
'url_name': 'secret:magic', 'display_name': 'secret:magic'}])
|
||||
|
||||
actual = render.toc_for_course(self.portal_user, request, self.toy_course, chapter, None, model_data_cache)
|
||||
self.assertEqual(expected, actual)
|
||||
assert reduce(lambda x, y: x and (y in actual), expected, True)
|
||||
|
||||
def test_toc_toy_from_section(self):
|
||||
chapter = 'Overview'
|
||||
@@ -169,4 +169,5 @@ class TestTOC(TestCase):
|
||||
'url_name': 'secret:magic', 'display_name': 'secret:magic'}])
|
||||
|
||||
actual = render.toc_for_course(self.portal_user, request, self.toy_course, chapter, section, model_data_cache)
|
||||
self.assertEqual(expected, actual)
|
||||
#from nose.tools import set_trace; set_trace();
|
||||
assert reduce(lambda x, y: x and (y in actual), expected, True)
|
||||
|
||||
@@ -21,7 +21,7 @@ class ProgressTestCase(TestCase):
|
||||
self.course = MagicMock()
|
||||
self.mockuser1.is_authenticated.return_value = True
|
||||
self.mockuser0.is_authenticated.return_value = False
|
||||
self.course.id = 'edX/full/6.002_Spring_2012'
|
||||
self.course.id = 'edX/toy/2012_Fall'
|
||||
self.tab = {'name': 'same'}
|
||||
self.active_page1 = 'progress'
|
||||
self.active_page0 = 'stagnation'
|
||||
@@ -51,7 +51,7 @@ class WikiTestCase(TestCase):
|
||||
|
||||
self.user = MagicMock()
|
||||
self.course = MagicMock()
|
||||
self.course.id = 'edX/full/6.002_Spring_2012'
|
||||
self.course.id = 'edX/toy/2012_Fall'
|
||||
self.tab = {'name': 'same'}
|
||||
self.active_page1 = 'wiki'
|
||||
self.active_page0 = 'miki'
|
||||
@@ -118,7 +118,7 @@ class StaticTabTestCase(TestCase):
|
||||
self.user = MagicMock()
|
||||
self.course = MagicMock()
|
||||
self.tabby = {'name': 'same', 'url_slug': 'schmug'}
|
||||
self.course.id = 'edX/full/6.002_Spring_2012'
|
||||
self.course.id = 'edX/toy/2012_Fall'
|
||||
self.active_page1 = 'static_tab_schmug'
|
||||
self.active_page0 = 'static_tab_schlug'
|
||||
|
||||
@@ -154,7 +154,7 @@ class TextbooksTestCase(TestCase):
|
||||
T = MagicMock()
|
||||
self.mockuser1.is_authenticated.return_value = True
|
||||
self.mockuser0.is_authenticated.return_value = False
|
||||
self.course.id = 'edX/full/6.002_Spring_2012'
|
||||
self.course.id = 'edX/toy/2012_Fall'
|
||||
self.active_page0 = 'textbook/0'
|
||||
self.active_page1 = 'textbook/1'
|
||||
self.active_pageX = 'you_shouldnt_be_seein_this'
|
||||
|
||||
@@ -104,7 +104,7 @@ class ViewsTestCase(TestCase):
|
||||
|
||||
def test_no_end_on_about_page(self):
|
||||
# Toy course has no course end date or about/end_date blob
|
||||
self.verify_end_date(self.course_id)
|
||||
self.verify_end_date('edX/toy/TT_2012_Fall')
|
||||
|
||||
def test_no_end_about_blob(self):
|
||||
# test_end has a course end date, no end_date HTML blob
|
||||
|
||||
@@ -163,15 +163,14 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
|
||||
import_from_xml(module_store, TEST_DATA_DIR, ['toy'])
|
||||
self.check_random_page_loads(module_store)
|
||||
|
||||
def test_full_textbooks_loads(self):
|
||||
def test_toy_textbooks_loads(self):
|
||||
module_store = modulestore()
|
||||
import_from_xml(module_store, TEST_DATA_DIR, ['full'])
|
||||
import_from_xml(module_store, TEST_DATA_DIR, ['toy'])
|
||||
|
||||
course = module_store.get_item(Location(['i4x', 'edX', 'full', 'course', '6.002_Spring_2012', None]))
|
||||
course = module_store.get_item(Location(['i4x', 'edX', 'toy', 'course', '2012_Fall', None]))
|
||||
|
||||
self.assertGreater(len(course.textbooks), 0)
|
||||
|
||||
|
||||
@override_settings(MODULESTORE=TEST_DATA_DRAFT_MONGO_MODULESTORE)
|
||||
class TestDraftModuleStore(TestCase):
|
||||
def test_get_items_with_course_items(self):
|
||||
|
||||
Reference in New Issue
Block a user