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
e5a440ef
Commit
e5a440ef
authored
Feb 03, 2015
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring the mocked user service.
TNL-836
parent
6266dcf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
cms/djangoapps/contentstore/tests/test_libraries.py
+3
-1
No files found.
cms/djangoapps/contentstore/tests/test_libraries.py
View file @
e5a440ef
...
...
@@ -12,6 +12,7 @@ from student.roles import (
CourseInstructorRole
,
CourseStaffRole
,
CourseCreatorRole
,
LibraryUserRole
,
OrgStaffRole
,
OrgInstructorRole
,
OrgLibraryUserRole
,
)
from
xblock.reference.user_service
import
XBlockUser
from
xmodule.library_content_module
import
LibraryVersionReference
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
...
...
@@ -80,7 +81,8 @@ class LibraryTestCase(ModuleStoreTestCase):
of a LibraryContent block
"""
if
'user'
not
in
lib_content_block
.
runtime
.
_services
:
# pylint: disable=protected-access
mocked_user_service
=
Mock
(
user_id
=
self
.
user
.
id
)
.
get_current_user
.
return_value
=
{}
mocked_user_service
=
Mock
(
user_id
=
self
.
user
.
id
)
mocked_user_service
.
get_current_user
.
return_value
=
XBlockUser
(
is_current_user
=
True
)
lib_content_block
.
runtime
.
_services
[
'user'
]
=
mocked_user_service
# pylint: disable=protected-access
handler_url
=
reverse_usage_url
(
...
...
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