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
9c533fa8
Commit
9c533fa8
authored
Nov 19, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test of module_render_code
parent
48ba871c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
lms/djangoapps/courseware/module_render.py
+2
-3
lms/djangoapps/courseware/tests/test_module_render.py
+11
-0
No files found.
lms/djangoapps/courseware/module_render.py
View file @
9c533fa8
...
...
@@ -279,10 +279,9 @@ def _get_module(user, request, location, student_module_cache, course_id, positi
shared_module
.
state
=
module
.
get_shared_state
()
shared_module
.
save
()
return
module
# TODO (vshnayder): Rename this? It's very confusing.
def
get_or_create_student_module
(
course_id
,
user
,
descriptor
,
student_module_cache
,
module
=
None
):
"""
Returns the StudentModule specific to this module for this student,
...
...
@@ -483,7 +482,7 @@ def modx_dispatch(request, dispatch, location, course_id):
student_module_cache
,
instance
)
shared_module
=
get_
shared_instance
_module
(
course_id
,
request
.
user
,
instance
,
student_module_cache
)
shared_module
=
get_
or_create_shared_student
_module
(
course_id
,
request
.
user
,
instance
,
student_module_cache
)
# Don't track state for anonymous users (who don't have student modules)
if
instance_module
is
not
None
:
...
...
lms/djangoapps/courseware/tests/test_module_render.py
0 → 100644
View file @
9c533fa8
from
mock
import
Mock
from
unittest
import
TestSuite
class
TestStudentModule
(
TestSuite
):
def
setUp
(
self
):
self
.
anon_user
=
Mock
()
self
.
anon_user
.
is_authenticated
.
return_value
=
True
def
anonymous_user
(
self
):
self
.
assert_equals
(
None
,
get_or_create_student_module
(
'course_id'
,
self
.
anon_user
,
None
,
None
,
None
))
\ No newline at end of file
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