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
d4633ae6
Commit
d4633ae6
authored
Aug 13, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CCX grading tests.
parent
a36fac93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
lms/djangoapps/ccx/tests/test_views.py
+6
-15
No files found.
lms/djangoapps/ccx/tests/test_views.py
View file @
d4633ae6
...
...
@@ -13,7 +13,6 @@ from capa.tests.response_xml_factory import StringResponseXMLFactory
from
courseware.courses
import
get_course_by_id
# pyline: disable=import-error
from
courseware.field_overrides
import
OverrideFieldData
# pylint: disable=import-error
from
courseware.models
import
StudentModule
from
courseware.tests.factories
import
StudentModuleFactory
# pylint: disable=import-error
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
# pylint: disable=import-error
from
courseware.tabs
import
get_course_tab_list
from
django.core.urlresolvers
import
reverse
...
...
@@ -548,24 +547,16 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase):
for
chapter
in
self
.
course
.
get_children
():
for
i
,
section
in
enumerate
(
chapter
.
get_children
()):
for
j
,
problem
in
enumerate
(
section
.
get_children
()):
if
not
j
:
# First iteration. Post-save signal will make the rest.
StudentModuleFactory
.
create
(
grade
=
1
if
i
<
j
else
0
,
max_grade
=
1
,
student
=
self
.
student
,
course_id
=
self
.
course
.
id
,
module_state_key
=
problem
.
location
)
continue
StudentModule
.
objects
.
filter
(
# Modules can be created elsewhere as a side effect in the code.
# Don't assume their existence.
module
,
_created
=
StudentModule
.
objects
.
get_or_create
(
student
=
self
.
student
,
course_id
=
self
.
course
.
id
,
module_state_key
=
problem
.
location
)
.
update
(
grade
=
1
if
i
<
j
else
0
,
max_grade
=
1
)
module
.
grade
=
1
if
i
<
j
else
0
module
.
max_grade
=
1
module
.
save
()
self
.
client
.
login
(
username
=
coach
.
username
,
password
=
"test"
)
...
...
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