MIT: CCX. Fixes for API changes that affect the binding of descriptors to student context.

fix for making sure all descriptor fields are always available for course descriptors despite module_class tricks

add required fields to cache data for tests

use a different strategy to mock up the get_children method
This commit is contained in:
cewing
2015-03-18 23:56:01 -07:00
parent b315b4d747
commit 8ba74429b1
4 changed files with 24 additions and 21 deletions

View File

@@ -835,8 +835,16 @@ class CourseFields(object):
)
class CourseModule(CourseFields, SequenceModule):
"""
The CourseDescriptor needs its module_class to be a SequenceModule, but some code that
expects a CourseDescriptor to have all its fields can fail if it gets a SequenceModule instead.
This class is to make sure that all the fields are present in all cases.
"""
class CourseDescriptor(CourseFields, SequenceDescriptor):
module_class = SequenceModule
module_class = CourseModule
def __init__(self, *args, **kwargs):
"""