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
d84e1f2d
Commit
d84e1f2d
authored
Oct 29, 2014
by
Calen Pennington
Committed by
Zia Fazal
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove proxying of resources_fs, and add a unittest that exposes the problem
[PLAT-191]
parent
bbd8ce4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
lms/djangoapps/courseware/tests/test_module_render.py
+20
-1
lms/lib/xblock/runtime.py
+0
-8
No files found.
lms/djangoapps/courseware/tests/test_module_render.py
View file @
d84e1f2d
# -*- coding: utf-8 -*-
"""
Test for lms courseware app, module render unit
"""
...
...
@@ -19,6 +18,7 @@ from courseware.module_render import hash_resource
from
xblock.field_data
import
FieldData
from
xblock.runtime
import
Runtime
from
xblock.fields
import
ScopeIds
from
xblock.core
import
XBlock
from
xmodule.lti_module
import
LTIDescriptor
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
@@ -43,6 +43,14 @@ from lms.lib.xblock.runtime import quote_slashes
from
xmodule.modulestore
import
ModuleStoreEnum
class
PureXBlock
(
XBlock
):
"""
Pure XBlock to use in tests.
"""
pass
@ddt.ddt
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
ModuleRenderTestCase
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
...
...
@@ -163,6 +171,17 @@ class ModuleRenderTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
self
.
assertEquals
(
403
,
response
.
status_code
)
self
.
assertEquals
(
'Unauthenticated'
,
response
.
content
)
@ddt.data
(
'pure'
,
'vertical'
)
@XBlock.register_temp_plugin
(
PureXBlock
,
identifier
=
'pure'
)
def
test_rebinding_same_user
(
self
,
block_type
):
request
=
self
.
request_factory
.
get
(
''
)
request
.
user
=
self
.
mock_user
course
=
CourseFactory
()
descriptor
=
ItemFactory
(
category
=
block_type
,
parent
=
course
)
field_data_cache
=
FieldDataCache
([
self
.
toy_course
,
descriptor
],
self
.
toy_course
.
id
,
self
.
mock_user
)
render
.
get_module_for_descriptor
(
self
.
mock_user
,
request
,
descriptor
,
field_data_cache
,
self
.
toy_course
.
id
)
render
.
get_module_for_descriptor
(
self
.
mock_user
,
request
,
descriptor
,
field_data_cache
,
self
.
toy_course
.
id
)
def
test_hash_resource
(
self
):
"""
Ensure that the resource hasher works and does not fail on unicode,
...
...
lms/lib/xblock/runtime.py
View file @
d84e1f2d
...
...
@@ -266,11 +266,3 @@ class LmsModuleSystem(LmsHandlerUrls, LmsCourse, LmsUser, ModuleSystem): # pyli
)
services
[
'fs'
]
=
xblock
.
reference
.
plugins
.
FSService
()
super
(
LmsModuleSystem
,
self
)
.
__init__
(
**
kwargs
)
# backward compatibility fix for callers not knowing this is a ModuleSystem v DescriptorSystem
@property
def
resources_fs
(
self
):
"""
Return what would be the resources_fs on a DescriptorSystem
"""
return
getattr
(
self
,
'filestore'
,
None
)
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