Commit c4c998b5 by Calen Pennington

Merge pull request #2954 from cpennington/pure-xblocks-progress-page

Fix LMS-2349 (Progress page broken for pure xblocks)
parents 945d8e05 a5498bcb
......@@ -301,6 +301,16 @@ class XModuleMixin(XBlockMixin):
"""
return self.icon_class
def has_dynamic_children(self):
"""
Returns True if this descriptor has dynamic children for a given
student when the module is created.
Returns False if the children of this descriptor are the same
children that the module will return for any student.
"""
return False
# Functions used in the LMS
def get_score(self):
......@@ -657,16 +667,6 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
self.edited_by = self.edited_on = self.previous_version = self.update_version = self.definition_locator = None
self.xmodule_runtime = None
def has_dynamic_children(self):
"""
Returns True if this descriptor has dynamic children for a given
student when the module is created.
Returns False if the children of this descriptor are the same
children that the module will return for any student.
"""
return False
@classmethod
def _translate(cls, key):
'VS[compat]'
......
......@@ -424,3 +424,32 @@ class StartDateTests(ModuleStoreTestCase):
text = self.get_about_text('edX/toy/TT_2012_Fall')
# The start date is set in common/test/data/two_toys/policies/TT_2012_Fall/policy.json
self.assertIn("2015-JULY-17", text)
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE)
class ProgressPageTests(ModuleStoreTestCase):
"""
Tests that verify that the progress page works correctly.
"""
def setUp(self):
self.request_factory = RequestFactory()
self.user = UserFactory.create()
self.request = self.request_factory.get("foo")
self.request.user = self.user
MakoMiddleware().process_request(self.request)
course = CourseFactory(start=datetime(2013, 9, 16, 7, 17, 28))
self.course = modulestore().get_instance(course.id, course.location) # pylint: disable=no-member
self.chapter = ItemFactory(category='chapter', parent_location=self.course.location) # pylint: disable=no-member
self.section = ItemFactory(category='sequential', parent_location=self.chapter.location)
self.vertical = ItemFactory(category='vertical', parent_location=self.section.location)
def test_pure_ungraded_xblock(self):
ItemFactory(category='acid', parent_location=self.vertical.location)
resp = views.progress(self.request, self.course.id)
self.assertEquals(resp.status_code, 200)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment