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
87596152
Commit
87596152
authored
Aug 05, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CCX tests work with post-save signal.
parent
b9c0b654
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
lms/djangoapps/ccx/tests/test_views.py
+15
-4
No files found.
lms/djangoapps/ccx/tests/test_views.py
View file @
87596152
...
@@ -12,6 +12,7 @@ from nose.plugins.attrib import attr
...
@@ -12,6 +12,7 @@ from nose.plugins.attrib import attr
from
capa.tests.response_xml_factory
import
StringResponseXMLFactory
from
capa.tests.response_xml_factory
import
StringResponseXMLFactory
from
courseware.courses
import
get_course_by_id
# pyline: disable=import-error
from
courseware.courses
import
get_course_by_id
# pyline: disable=import-error
from
courseware.field_overrides
import
OverrideFieldData
# pylint: 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.factories
import
StudentModuleFactory
# pylint: disable=import-error
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
# pylint: disable=import-error
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
# pylint: disable=import-error
from
courseware.tabs
import
get_course_tab_list
from
courseware.tabs
import
get_course_tab_list
...
@@ -547,13 +548,23 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -547,13 +548,23 @@ class TestCCXGrades(ModuleStoreTestCase, LoginEnrollmentTestCase):
for
chapter
in
self
.
course
.
get_children
():
for
chapter
in
self
.
course
.
get_children
():
for
i
,
section
in
enumerate
(
chapter
.
get_children
()):
for
i
,
section
in
enumerate
(
chapter
.
get_children
()):
for
j
,
problem
in
enumerate
(
section
.
get_children
()):
for
j
,
problem
in
enumerate
(
section
.
get_children
()):
# if not problem.visible_to_staff_only:
if
not
j
:
StudentModuleFactory
.
create
(
# First iteration. Post-save signal will make the rest.
grade
=
1
if
i
<
j
else
0
,
StudentModuleFactory
.
create
(
max_grade
=
1
,
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
(
student
=
self
.
student
,
student
=
self
.
student
,
course_id
=
self
.
course
.
id
,
course_id
=
self
.
course
.
id
,
module_state_key
=
problem
.
location
module_state_key
=
problem
.
location
)
.
update
(
grade
=
1
if
i
<
j
else
0
,
max_grade
=
1
)
)
self
.
client
.
login
(
username
=
coach
.
username
,
password
=
"test"
)
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