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
76f76a4f
Commit
76f76a4f
authored
Dec 07, 2012
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests and mock objects to work with the new API
parent
4ccf7c35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
lms/djangoapps/instructor/staff_grading_service.py
+1
-1
lms/djangoapps/instructor/tests.py
+5
-2
No files found.
lms/djangoapps/instructor/staff_grading_service.py
View file @
76f76a4f
...
@@ -43,7 +43,7 @@ class MockStaffGradingService(object):
...
@@ -43,7 +43,7 @@ class MockStaffGradingService(object):
'rubric'
:
'A rubric'
})
'rubric'
:
'A rubric'
})
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
):
def
save_grade
(
self
,
course_id
,
grader_id
,
submission_id
,
score
,
feedback
):
return
self
.
get_next
(
course_id
,
grader_id
)
return
self
.
get_next
(
course_id
,
'fake location'
,
grader_id
)
class
StaffGradingService
(
object
):
class
StaffGradingService
(
object
):
...
...
lms/djangoapps/instructor/tests.py
View file @
76f76a4f
...
@@ -236,6 +236,7 @@ class TestStaffGradingService(ct.PageLoader):
...
@@ -236,6 +236,7 @@ class TestStaffGradingService(ct.PageLoader):
self
.
student
=
'view@test.com'
self
.
student
=
'view@test.com'
self
.
instructor
=
'view2@test.com'
self
.
instructor
=
'view2@test.com'
self
.
password
=
'foo'
self
.
password
=
'foo'
self
.
location
=
'TestLocation'
self
.
create_account
(
'u1'
,
self
.
student
,
self
.
password
)
self
.
create_account
(
'u1'
,
self
.
student
,
self
.
password
)
self
.
create_account
(
'u2'
,
self
.
instructor
,
self
.
password
)
self
.
create_account
(
'u2'
,
self
.
instructor
,
self
.
password
)
self
.
activate_user
(
self
.
student
)
self
.
activate_user
(
self
.
student
)
...
@@ -271,8 +272,9 @@ class TestStaffGradingService(ct.PageLoader):
...
@@ -271,8 +272,9 @@ class TestStaffGradingService(ct.PageLoader):
self
.
login
(
self
.
instructor
,
self
.
password
)
self
.
login
(
self
.
instructor
,
self
.
password
)
url
=
reverse
(
'staff_grading_get_next'
,
kwargs
=
{
'course_id'
:
self
.
course_id
})
url
=
reverse
(
'staff_grading_get_next'
,
kwargs
=
{
'course_id'
:
self
.
course_id
})
data
=
{
'location'
:
self
.
location
}
r
=
self
.
check_for_
get_code
(
200
,
url
)
r
=
self
.
check_for_
post_code
(
200
,
url
,
data
)
d
=
json
.
loads
(
r
.
content
)
d
=
json
.
loads
(
r
.
content
)
self
.
assertTrue
(
d
[
'success'
])
self
.
assertTrue
(
d
[
'success'
])
self
.
assertEquals
(
d
[
'submission_id'
],
self
.
mock_service
.
cnt
)
self
.
assertEquals
(
d
[
'submission_id'
],
self
.
mock_service
.
cnt
)
...
@@ -285,7 +287,8 @@ class TestStaffGradingService(ct.PageLoader):
...
@@ -285,7 +287,8 @@ class TestStaffGradingService(ct.PageLoader):
data
=
{
'score'
:
'12'
,
data
=
{
'score'
:
'12'
,
'feedback'
:
'great!'
,
'feedback'
:
'great!'
,
'submission_id'
:
'123'
}
'submission_id'
:
'123'
,
'location'
:
self
.
location
}
r
=
self
.
check_for_post_code
(
200
,
url
,
data
)
r
=
self
.
check_for_post_code
(
200
,
url
,
data
)
d
=
json
.
loads
(
r
.
content
)
d
=
json
.
loads
(
r
.
content
)
self
.
assertTrue
(
d
[
'success'
],
str
(
d
))
self
.
assertTrue
(
d
[
'success'
],
str
(
d
))
...
...
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