Fixes for course import-export:

* Updated XBlock hash - new version forces exposes force_dirty method on fields
* Includes Scope.children fields into xml_importer._update_module_location so that they are updated as well.
* Tests for mutable fields xml_importer._update_module_location with mutable fields and children
This commit is contained in:
E. Kolpakov
2015-04-27 17:09:57 +03:00
parent c776272a8f
commit 6db974c8ee
4 changed files with 99 additions and 7 deletions

View File

@@ -492,10 +492,13 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase):
# sure if there's a way to poke the test harness to do so. So, we'll
# just inject the override field storage in this brute force manner.
OverrideFieldData.provider_classes = None
# pylint: disable=protected-access
for block in iter_blocks(course):
block._field_data = OverrideFieldData.wrap( # pylint: disable=protected-access
coach, block._field_data) # pylint: disable=protected-access
block._field_data_cache = {'tabs': [], 'discussion_topics': []} # pylint: disable=protected-access
block._field_data = OverrideFieldData.wrap(coach, block._field_data)
new_cache = {'tabs': [], 'discussion_topics': []}
if 'grading_policy' in block._field_data_cache:
new_cache['grading_policy'] = block._field_data_cache['grading_policy']
block._field_data_cache = new_cache
def cleanup_provider_classes():
"""