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
4a20370f
Commit
4a20370f
authored
Oct 25, 2016
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update CourseGradeFactory.create to be read_only by default
TNL-5835
parent
a1499e28
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
34 deletions
+34
-34
lms/djangoapps/ccx/tests/test_field_override_performance.py
+27
-27
lms/djangoapps/courseware/tests/test_views.py
+3
-3
lms/djangoapps/courseware/views/views.py
+1
-1
lms/djangoapps/grades/new/course_grade.py
+1
-1
lms/djangoapps/grades/tests/test_new.py
+1
-1
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
+1
-1
No files found.
lms/djangoapps/ccx/tests/test_field_override_performance.py
View file @
4a20370f
...
...
@@ -229,18 +229,18 @@ class TestFieldOverrideMongoPerformance(FieldOverridePerformanceTestCase):
# # of sql queries to default,
# # of mongo queries,
# )
(
'no_overrides'
,
1
,
True
,
False
):
(
22
,
6
),
(
'no_overrides'
,
2
,
True
,
False
):
(
22
,
6
),
(
'no_overrides'
,
3
,
True
,
False
):
(
22
,
6
),
(
'ccx'
,
1
,
True
,
False
):
(
22
,
6
),
(
'ccx'
,
2
,
True
,
False
):
(
22
,
6
),
(
'ccx'
,
3
,
True
,
False
):
(
22
,
6
),
(
'no_overrides'
,
1
,
False
,
False
):
(
22
,
6
),
(
'no_overrides'
,
2
,
False
,
False
):
(
22
,
6
),
(
'no_overrides'
,
3
,
False
,
False
):
(
22
,
6
),
(
'ccx'
,
1
,
False
,
False
):
(
22
,
6
),
(
'ccx'
,
2
,
False
,
False
):
(
22
,
6
),
(
'ccx'
,
3
,
False
,
False
):
(
22
,
6
),
(
'no_overrides'
,
1
,
True
,
False
):
(
17
,
6
),
(
'no_overrides'
,
2
,
True
,
False
):
(
17
,
6
),
(
'no_overrides'
,
3
,
True
,
False
):
(
17
,
6
),
(
'ccx'
,
1
,
True
,
False
):
(
17
,
6
),
(
'ccx'
,
2
,
True
,
False
):
(
17
,
6
),
(
'ccx'
,
3
,
True
,
False
):
(
17
,
6
),
(
'no_overrides'
,
1
,
False
,
False
):
(
17
,
6
),
(
'no_overrides'
,
2
,
False
,
False
):
(
17
,
6
),
(
'no_overrides'
,
3
,
False
,
False
):
(
17
,
6
),
(
'ccx'
,
1
,
False
,
False
):
(
17
,
6
),
(
'ccx'
,
2
,
False
,
False
):
(
17
,
6
),
(
'ccx'
,
3
,
False
,
False
):
(
17
,
6
),
}
...
...
@@ -252,19 +252,19 @@ class TestFieldOverrideSplitPerformance(FieldOverridePerformanceTestCase):
__test__
=
True
TEST_DATA
=
{
(
'no_overrides'
,
1
,
True
,
False
):
(
22
,
3
),
(
'no_overrides'
,
2
,
True
,
False
):
(
22
,
3
),
(
'no_overrides'
,
3
,
True
,
False
):
(
22
,
3
),
(
'ccx'
,
1
,
True
,
False
):
(
22
,
3
),
(
'ccx'
,
2
,
True
,
False
):
(
22
,
3
),
(
'ccx'
,
3
,
True
,
False
):
(
22
,
3
),
(
'ccx'
,
1
,
True
,
True
):
(
23
,
3
),
(
'ccx'
,
2
,
True
,
True
):
(
23
,
3
),
(
'ccx'
,
3
,
True
,
True
):
(
23
,
3
),
(
'no_overrides'
,
1
,
False
,
False
):
(
22
,
3
),
(
'no_overrides'
,
2
,
False
,
False
):
(
22
,
3
),
(
'no_overrides'
,
3
,
False
,
False
):
(
22
,
3
),
(
'ccx'
,
1
,
False
,
False
):
(
22
,
3
),
(
'ccx'
,
2
,
False
,
False
):
(
22
,
3
),
(
'ccx'
,
3
,
False
,
False
):
(
22
,
3
),
(
'no_overrides'
,
1
,
True
,
False
):
(
17
,
3
),
(
'no_overrides'
,
2
,
True
,
False
):
(
17
,
3
),
(
'no_overrides'
,
3
,
True
,
False
):
(
17
,
3
),
(
'ccx'
,
1
,
True
,
False
):
(
17
,
3
),
(
'ccx'
,
2
,
True
,
False
):
(
17
,
3
),
(
'ccx'
,
3
,
True
,
False
):
(
17
,
3
),
(
'ccx'
,
1
,
True
,
True
):
(
18
,
3
),
(
'ccx'
,
2
,
True
,
True
):
(
18
,
3
),
(
'ccx'
,
3
,
True
,
True
):
(
18
,
3
),
(
'no_overrides'
,
1
,
False
,
False
):
(
17
,
3
),
(
'no_overrides'
,
2
,
False
,
False
):
(
17
,
3
),
(
'no_overrides'
,
3
,
False
,
False
):
(
17
,
3
),
(
'ccx'
,
1
,
False
,
False
):
(
17
,
3
),
(
'ccx'
,
2
,
False
,
False
):
(
17
,
3
),
(
'ccx'
,
3
,
False
,
False
):
(
17
,
3
),
}
lms/djangoapps/courseware/tests/test_views.py
View file @
4a20370f
...
...
@@ -1345,17 +1345,17 @@ class ProgressPageTests(ModuleStoreTestCase):
"""Test that query counts remain the same for self-paced and instructor-paced courses."""
SelfPacedConfiguration
(
enabled
=
self_paced_enabled
)
.
save
()
self
.
setup_course
(
self_paced
=
self_paced
)
with
self
.
assertNumQueries
(
3
9
),
check_mongo_calls
(
4
):
with
self
.
assertNumQueries
(
3
4
),
check_mongo_calls
(
4
):
self
.
_get_progress_page
()
def
test_progress_queries
(
self
):
self
.
setup_course
()
with
self
.
assertNumQueries
(
3
9
),
check_mongo_calls
(
4
):
with
self
.
assertNumQueries
(
3
4
),
check_mongo_calls
(
4
):
self
.
_get_progress_page
()
# subsequent accesses to the progress page require fewer queries.
for
_
in
range
(
2
):
with
self
.
assertNumQueries
(
2
2
),
check_mongo_calls
(
4
):
with
self
.
assertNumQueries
(
2
0
),
check_mongo_calls
(
4
):
self
.
_get_progress_page
()
@patch
(
...
...
lms/djangoapps/courseware/views/views.py
View file @
4a20370f
...
...
@@ -719,7 +719,7 @@ def _progress(request, course_key, student_id):
# additional DB lookup (this kills the Progress page in particular).
student
=
User
.
objects
.
prefetch_related
(
"groups"
)
.
get
(
id
=
student
.
id
)
course_grade
=
CourseGradeFactory
(
student
)
.
create
(
course
,
read_only
=
False
)
course_grade
=
CourseGradeFactory
(
student
)
.
create
(
course
)
if
not
course_grade
.
has_access_to_course
:
# This means the student didn't have access to the course (which the instructor requested)
raise
Http404
...
...
lms/djangoapps/grades/new/course_grade.py
View file @
4a20370f
...
...
@@ -248,7 +248,7 @@ class CourseGradeFactory(object):
def
__init__
(
self
,
student
):
self
.
student
=
student
def
create
(
self
,
course
,
read_only
=
Fals
e
):
def
create
(
self
,
course
,
read_only
=
Tru
e
):
"""
Returns the CourseGrade object for the given student and course.
...
...
lms/djangoapps/grades/tests/test_new.py
View file @
4a20370f
...
...
@@ -546,7 +546,7 @@ class TestCourseGradeLogging(SharedModuleStoreTestCase):
Creates a course grade and asserts that the associated logging
matches the expected totals passed in to the function.
"""
factory
.
create
(
self
.
course
)
factory
.
create
(
self
.
course
,
read_only
=
False
)
log_statement
=
u''
.
join
((
u"compute_and_update, read_only: {0}, subsections read/created: {1}/{2}, blocks "
,
u"accessed: {3}, total graded subsections: {4}"
...
...
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
View file @
4a20370f
...
...
@@ -1674,7 +1674,7 @@ class TestCertificateGeneration(InstructorTaskModuleTestCase):
'failed'
:
3
,
'skipped'
:
2
}
with
self
.
assertNumQueries
(
1
91
):
with
self
.
assertNumQueries
(
1
58
):
self
.
assertCertificatesGenerated
(
task_input
,
expected_results
)
expected_results
=
{
...
...
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