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
1b94666c
Commit
1b94666c
authored
May 16, 2017
by
J. Cliff Dyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use mock's ANY
parent
7127ab86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
lms/djangoapps/grades/management/commands/tests/test_compute_grades.py
+4
-12
No files found.
lms/djangoapps/grades/management/commands/tests/test_compute_grades.py
View file @
1b94666c
...
...
@@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import
ddt
from
django.contrib.auth
import
get_user_model
from
django.core.management
import
CommandError
,
call_command
from
mock
import
patch
from
mock
import
ANY
,
patch
import
six
from
student.models
import
CourseEnrollment
...
...
@@ -27,14 +27,6 @@ def _sorted_by_batch(calls):
return
sorted
(
calls
,
key
=
lambda
x
:
(
x
[
1
][
'kwargs'
][
'course_key'
],
x
[
1
][
'kwargs'
][
'offset'
]))
class
Any
(
object
):
"""
Dummy object that compares equal to all other objects.
"""
def
__eq__
(
self
,
other
):
return
True
@ddt.ddt
class
TestComputeGrades
(
SharedModuleStoreTestCase
):
"""
...
...
@@ -109,7 +101,7 @@ class TestComputeGrades(SharedModuleStoreTestCase):
'batch_size'
:
2
,
'offset'
:
offset
,
'estimate_first_attempted'
:
estimate_first_attempted
,
'seq_id'
:
A
ny
()
,
'seq_id'
:
A
NY
,
}
self
.
assertEqual
(
_sorted_by_batch
(
mock_task
.
apply_async
.
call_args_list
),
...
...
@@ -146,7 +138,7 @@ class TestComputeGrades(SharedModuleStoreTestCase):
'batch_size'
:
2
,
'offset'
:
0
,
'estimate_first_attempted'
:
True
,
'seq_id'
:
A
ny
()
,
'seq_id'
:
A
NY
,
},
},),
({
...
...
@@ -155,7 +147,7 @@ class TestComputeGrades(SharedModuleStoreTestCase):
'batch_size'
:
2
,
'offset'
:
2
,
'estimate_first_attempted'
:
True
,
'seq_id'
:
A
ny
()
,
'seq_id'
:
A
NY
,
},
},),
],
...
...
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