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
122039ac
Commit
122039ac
authored
May 20, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add __len__ to FieldDataCache
parent
4625036d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
lms/djangoapps/courseware/model_data.py
+3
-0
lms/djangoapps/courseware/tests/test_model_data.py
+1
-1
No files found.
lms/djangoapps/courseware/model_data.py
View file @
122039ac
...
...
@@ -951,3 +951,6 @@ class FieldDataCache(object):
return
None
return
self
.
cache
[
key
.
scope
]
.
last_modified
(
key
)
def
__len__
(
self
):
return
sum
(
len
(
cache
)
for
cache
in
self
.
cache
.
values
())
lms/djangoapps/courseware/tests/test_model_data.py
View file @
122039ac
...
...
@@ -242,7 +242,7 @@ class TestMissingStudentModule(TestCase):
def
test_set_field_in_missing_student_module
(
self
):
"Test that setting a field in a missing StudentModule creates the student module"
self
.
assertEquals
(
0
,
sum
(
len
(
cache
)
for
cache
in
self
.
field_data_cache
.
cache
.
values
()
))
self
.
assertEquals
(
0
,
len
(
self
.
field_data_cache
))
self
.
assertEquals
(
0
,
StudentModule
.
objects
.
all
()
.
count
())
# We are updating a problem, so we write to courseware_studentmodulehistory
...
...
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