Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f016647f
Commit
f016647f
authored
Jun 21, 2016
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Block Transformer Registry in tests
parent
85687dcf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
36 deletions
+7
-36
lms/djangoapps/course_api/blocks/tests/test_api.py
+1
-2
lms/djangoapps/course_api/blocks/tests/test_forms.py
+1
-2
lms/djangoapps/course_api/blocks/tests/test_serializers.py
+1
-2
lms/djangoapps/course_api/blocks/tests/test_views.py
+1
-2
lms/djangoapps/courseware/tests/test_discussion_module.py
+1
-2
lms/envs/test.py
+0
-5
openedx/core/djangoapps/content/block_structure/tests/helpers.py
+0
-19
openedx/core/djangoapps/content/block_structure/tests/test_signals.py
+2
-2
No files found.
lms/djangoapps/course_api/blocks/tests/test_api.py
View file @
f016647f
...
@@ -4,7 +4,6 @@ Tests for Blocks api.py
...
@@ -4,7 +4,6 @@ Tests for Blocks api.py
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
openedx.core.djangoapps.content.block_structure.tests.helpers
import
EnableTransformerRegistryMixin
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
...
@@ -13,7 +12,7 @@ from xmodule.modulestore.tests.factories import SampleCourseFactory
...
@@ -13,7 +12,7 @@ from xmodule.modulestore.tests.factories import SampleCourseFactory
from
..api
import
get_blocks
from
..api
import
get_blocks
class
TestGetBlocks
(
EnableTransformerRegistryMixin
,
SharedModuleStoreTestCase
):
class
TestGetBlocks
(
SharedModuleStoreTestCase
):
"""
"""
Tests for the get_blocks function
Tests for the get_blocks function
"""
"""
...
...
lms/djangoapps/course_api/blocks/tests/test_forms.py
View file @
f016647f
...
@@ -7,7 +7,6 @@ from urllib import urlencode
...
@@ -7,7 +7,6 @@ from urllib import urlencode
from
rest_framework.exceptions
import
PermissionDenied
from
rest_framework.exceptions
import
PermissionDenied
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
openedx.core.djangoapps.content.block_structure.tests.helpers
import
EnableTransformerRegistryMixin
from
openedx.core.djangoapps.util.test_forms
import
FormTestMixin
from
openedx.core.djangoapps.util.test_forms
import
FormTestMixin
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
...
@@ -18,7 +17,7 @@ from ..forms import BlockListGetForm
...
@@ -18,7 +17,7 @@ from ..forms import BlockListGetForm
@ddt.ddt
@ddt.ddt
class
TestBlockListGetForm
(
EnableTransformerRegistryMixin
,
FormTestMixin
,
SharedModuleStoreTestCase
):
class
TestBlockListGetForm
(
FormTestMixin
,
SharedModuleStoreTestCase
):
"""
"""
Tests for BlockListGetForm
Tests for BlockListGetForm
"""
"""
...
...
lms/djangoapps/course_api/blocks/tests/test_serializers.py
View file @
f016647f
...
@@ -3,7 +3,6 @@ Tests for Course Blocks serializers
...
@@ -3,7 +3,6 @@ Tests for Course Blocks serializers
"""
"""
from
mock
import
MagicMock
from
mock
import
MagicMock
from
openedx.core.djangoapps.content.block_structure.tests.helpers
import
EnableTransformerRegistryMixin
from
openedx.core.lib.block_structure.transformers
import
BlockStructureTransformers
from
openedx.core.lib.block_structure.transformers
import
BlockStructureTransformers
from
student.tests.factories
import
UserFactory
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
...
@@ -17,7 +16,7 @@ from ..serializers import BlockSerializer, BlockDictSerializer
...
@@ -17,7 +16,7 @@ from ..serializers import BlockSerializer, BlockDictSerializer
from
.helpers
import
deserialize_usage_key
from
.helpers
import
deserialize_usage_key
class
TestBlockSerializerBase
(
EnableTransformerRegistryMixin
,
SharedModuleStoreTestCase
):
class
TestBlockSerializerBase
(
SharedModuleStoreTestCase
):
"""
"""
Base class for testing BlockSerializer and BlockDictSerializer
Base class for testing BlockSerializer and BlockDictSerializer
"""
"""
...
...
lms/djangoapps/course_api/blocks/tests/test_views.py
View file @
f016647f
...
@@ -8,7 +8,6 @@ from urllib import urlencode
...
@@ -8,7 +8,6 @@ from urllib import urlencode
from
urlparse
import
urlunparse
from
urlparse
import
urlunparse
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
openedx.core.djangoapps.content.block_structure.tests.helpers
import
EnableTransformerRegistryMixin
from
student.models
import
CourseEnrollment
from
student.models
import
CourseEnrollment
from
student.tests.factories
import
AdminFactory
,
CourseEnrollmentFactory
,
UserFactory
from
student.tests.factories
import
AdminFactory
,
CourseEnrollmentFactory
,
UserFactory
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
...
@@ -17,7 +16,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory
...
@@ -17,7 +16,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory
from
.helpers
import
deserialize_usage_key
from
.helpers
import
deserialize_usage_key
class
TestBlocksView
(
EnableTransformerRegistryMixin
,
SharedModuleStoreTestCase
):
class
TestBlocksView
(
SharedModuleStoreTestCase
):
"""
"""
Test class for BlocksView
Test class for BlocksView
"""
"""
...
...
lms/djangoapps/courseware/tests/test_discussion_module.py
View file @
f016647f
...
@@ -6,7 +6,6 @@ from mock import Mock
...
@@ -6,7 +6,6 @@ from mock import Mock
from
.
import
BaseTestXmodule
from
.
import
BaseTestXmodule
from
course_api.blocks.tests.helpers
import
deserialize_usage_key
from
course_api.blocks.tests.helpers
import
deserialize_usage_key
from
courseware.module_render
import
get_module_for_descriptor_internal
from
courseware.module_render
import
get_module_for_descriptor_internal
from
openedx.core.djangoapps.content.block_structure.tests.helpers
import
EnableTransformerRegistryMixin
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
student.tests.factories
import
UserFactory
,
CourseEnrollmentFactory
from
xmodule.discussion_module
import
DiscussionModule
from
xmodule.discussion_module
import
DiscussionModule
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
...
@@ -16,7 +15,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory, ItemFactory
...
@@ -16,7 +15,7 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory, ItemFactory
@ddt.ddt
@ddt.ddt
class
DiscussionModuleTest
(
BaseTestXmodule
,
EnableTransformerRegistryMixin
,
SharedModuleStoreTestCase
):
class
DiscussionModuleTest
(
BaseTestXmodule
,
SharedModuleStoreTestCase
):
"""Logic tests for Discussion Xmodule."""
"""Logic tests for Discussion Xmodule."""
CATEGORY
=
"discussion"
CATEGORY
=
"discussion"
...
...
lms/envs/test.py
View file @
f016647f
...
@@ -577,11 +577,6 @@ JWT_AUTH.update({
...
@@ -577,11 +577,6 @@ JWT_AUTH.update({
'JWT_AUDIENCE'
:
'test-key'
,
'JWT_AUDIENCE'
:
'test-key'
,
})
})
# Disable the use of the plugin manager in the transformer registry for
# better performant unit tests.
from
openedx.core.lib.block_structure.transformer_registry
import
TransformerRegistry
TransformerRegistry
.
USE_PLUGIN_MANAGER
=
False
# Set the default Oauth2 Provider Model so that migrations can run in
# Set the default Oauth2 Provider Model so that migrations can run in
# verbose mode
# verbose mode
OAUTH2_PROVIDER_APPLICATION_MODEL
=
'oauth2_provider.Application'
OAUTH2_PROVIDER_APPLICATION_MODEL
=
'oauth2_provider.Application'
...
...
openedx/core/djangoapps/content/block_structure/tests/helpers.py
View file @
f016647f
...
@@ -3,28 +3,9 @@ Helpers for Course Blocks tests.
...
@@ -3,28 +3,9 @@ Helpers for Course Blocks tests.
"""
"""
from
openedx.core.lib.block_structure.cache
import
BlockStructureCache
from
openedx.core.lib.block_structure.cache
import
BlockStructureCache
from
openedx.core.lib.block_structure.transformer_registry
import
TransformerRegistry
from
..api
import
get_cache
from
..api
import
get_cache
class
EnableTransformerRegistryMixin
(
object
):
"""
Mixin that enables the TransformerRegistry to USE_PLUGIN_MANAGER for
finding registered transformers. USE_PLUGIN_MANAGER is set to False
for LMS unit tests to speed up performance of the unit tests, so all
registered transformers in the platform do not need to be collected.
This Mixin is expected to be used by Tests for integration testing
with all registered transformers.
"""
def
setUp
(
self
,
**
kwargs
):
super
(
EnableTransformerRegistryMixin
,
self
)
.
setUp
(
**
kwargs
)
TransformerRegistry
.
USE_PLUGIN_MANAGER
=
True
def
tearDown
(
self
):
super
(
EnableTransformerRegistryMixin
,
self
)
.
tearDown
()
TransformerRegistry
.
USE_PLUGIN_MANAGER
=
False
def
is_course_in_block_structure_cache
(
course_key
,
store
):
def
is_course_in_block_structure_cache
(
course_key
,
store
):
"""
"""
Returns whether the given course is in the Block Structure cache.
Returns whether the given course is in the Block Structure cache.
...
...
openedx/core/djangoapps/content/block_structure/tests/test_signals.py
View file @
f016647f
...
@@ -7,10 +7,10 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...
@@ -7,10 +7,10 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
..api
import
get_block_structure_manager
from
..api
import
get_block_structure_manager
from
.helpers
import
is_course_in_block_structure_cache
,
EnableTransformerRegistryMixin
from
.helpers
import
is_course_in_block_structure_cache
class
CourseBlocksSignalTest
(
EnableTransformerRegistryMixin
,
ModuleStoreTestCase
):
class
CourseBlocksSignalTest
(
ModuleStoreTestCase
):
"""
"""
Tests for the Course Blocks signal
Tests for the Course Blocks signal
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment