-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[OldMongo FC-0004] Remove support for children in Old Mongo #31134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
504a72f
c19ce6b
a927db9
81f3ac8
5223c10
6d53ab4
ede39e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,6 @@ | |
| from xblock.core import XBlock | ||
| from xblock.fields import String | ||
|
|
||
| from xmodule.modulestore import ModuleStoreEnum | ||
| from xmodule.modulestore.django import modulestore | ||
| from xmodule.modulestore.mongo.draft import as_draft | ||
| from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase | ||
| from xmodule.modulestore.xml_importer import import_course_from_xml | ||
|
|
||
|
|
@@ -41,14 +38,6 @@ def test_import_public(self): | |
| 'set by xml' | ||
| ) | ||
|
|
||
| @XBlock.register_temp_plugin(StubXBlock) | ||
| def test_import_draft(self): | ||
| self._assert_import( | ||
| 'pure_xblock_draft', | ||
| 'set by xml', | ||
| has_draft=True | ||
| ) | ||
|
|
||
| def _assert_import(self, course_dir, expected_field_val, has_draft=False): | ||
| """ | ||
| Import a course from XML, then verify that the XBlock was loaded | ||
|
|
@@ -66,22 +55,12 @@ def _assert_import(self, course_dir, expected_field_val, has_draft=False): | |
| """ | ||
| # It is necessary to use the "old mongo" modulestore because split doesn't work | ||
| # with the "has_draft" logic below. | ||
| store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo) # pylint: disable=protected-access | ||
| courses = import_course_from_xml( | ||
| store, self.user.id, TEST_DATA_DIR, [course_dir], create_if_not_present=True | ||
| self.store, self.user.id, TEST_DATA_DIR, [course_dir], create_if_not_present=True | ||
| ) | ||
|
|
||
| xblock_location = courses[0].id.make_usage_key('stubxblock', 'xblock_test') | ||
|
|
||
| if has_draft: | ||
|
||
| xblock_location = as_draft(xblock_location) | ||
|
|
||
| xblock = store.get_item(xblock_location) | ||
| xblock = self.store.get_item(xblock_location) | ||
| self.assertTrue(isinstance(xblock, StubXBlock)) | ||
| self.assertEqual(xblock.test_field, expected_field_val) | ||
|
|
||
| if has_draft: | ||
| draft_xblock = store.get_item(xblock_location) | ||
| self.assertTrue(getattr(draft_xblock, 'is_draft', False)) | ||
| self.assertTrue(isinstance(draft_xblock, StubXBlock)) | ||
| self.assertEqual(draft_xblock.test_field, expected_field_val) | ||
Uh oh!
There was an error while loading. Please reload this page.