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
7b8b168f
Commit
7b8b168f
authored
May 08, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the mockquerydict
parent
a2e5bd07
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
common/lib/xmodule/xmodule/tests/dummy_system.py
+2
-14
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+2
-1
common/lib/xmodule/xmodule/tests/test_peer_grading.py
+2
-1
common/lib/xmodule/xmodule/tests/test_util_open_ended.py
+15
-3
No files found.
common/lib/xmodule/xmodule/tests/dummy_system.py
View file @
7b8b168f
...
@@ -51,16 +51,4 @@ class DummySystemUser(object):
...
@@ -51,16 +51,4 @@ class DummySystemUser(object):
if
not
isinstance
(
location
,
Location
):
if
not
isinstance
(
location
,
Location
):
location
=
Location
(
location
)
location
=
Location
(
location
)
descriptor
=
self
.
modulestore
.
get_instance
(
course
.
id
,
location
,
depth
=
None
)
descriptor
=
self
.
modulestore
.
get_instance
(
course
.
id
,
location
,
depth
=
None
)
return
descriptor
.
xmodule
(
self
.
test_system
)
return
descriptor
.
xmodule
(
self
.
test_system
)
\ No newline at end of file
class
MockQueryDict
(
dict
):
"""
Mock a query set so that it can be used with default authorization
"""
def
getlist
(
self
,
key
,
default
=
None
):
try
:
return
super
(
MockQueryDict
,
self
)
.
__getitem__
(
key
)
except
KeyError
:
if
default
is
None
:
return
[]
return
default
\ No newline at end of file
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
7b8b168f
...
@@ -2,7 +2,8 @@ import json
...
@@ -2,7 +2,8 @@ import json
from
mock
import
Mock
,
MagicMock
,
ANY
from
mock
import
Mock
,
MagicMock
,
ANY
import
unittest
import
unittest
from
dummy_system
import
DummySystemUser
,
MockQueryDict
from
dummy_system
import
DummySystemUser
from
test_util_open_ended
import
MockQueryDict
from
xmodule.open_ended_grading_classes.openendedchild
import
OpenEndedChild
from
xmodule.open_ended_grading_classes.openendedchild
import
OpenEndedChild
from
xmodule.open_ended_grading_classes.open_ended_module
import
OpenEndedModule
from
xmodule.open_ended_grading_classes.open_ended_module
import
OpenEndedModule
...
...
common/lib/xmodule/xmodule/tests/test_peer_grading.py
View file @
7b8b168f
...
@@ -4,7 +4,8 @@ import json
...
@@ -4,7 +4,8 @@ import json
from
lxml
import
etree
from
lxml
import
etree
from
mock
import
Mock
from
mock
import
Mock
from
.
import
test_system
from
.
import
test_system
from
dummy_system
import
DummySystem
,
DummySystemUser
,
MockQueryDict
from
dummy_system
import
DummySystem
,
DummySystemUser
from
test_util_open_ended
import
MockQueryDict
from
xmodule.peer_grading_module
import
PeerGradingModule
,
PeerGradingDescriptor
from
xmodule.peer_grading_module
import
PeerGradingModule
,
PeerGradingDescriptor
from
xmodule.open_ended_grading_classes.grading_service_module
import
GradingServiceError
from
xmodule.open_ended_grading_classes.grading_service_module
import
GradingServiceError
...
...
common/lib/xmodule/xmodule/tests/test_util_open_ended.py
View file @
7b8b168f
OPEN_ENDED_GRADING_INTERFACE
=
{
OPEN_ENDED_GRADING_INTERFACE
=
{
'url'
:
'
http://127.0.0.1:3033
/'
,
'url'
:
'
blah
/'
,
'username'
:
'incorrect'
,
'username'
:
'incorrect'
,
'password'
:
'incorrect'
,
'password'
:
'incorrect'
,
'staff_grading'
:
'staff_grading'
,
'staff_grading'
:
'staff_grading'
,
...
@@ -11,4 +11,16 @@ S3_INTERFACE = {
...
@@ -11,4 +11,16 @@ S3_INTERFACE = {
'aws_access_key'
:
""
,
'aws_access_key'
:
""
,
'aws_secret_key'
:
""
,
'aws_secret_key'
:
""
,
"aws_bucket_name"
:
""
,
"aws_bucket_name"
:
""
,
}
}
\ No newline at end of file
class
MockQueryDict
(
dict
):
"""
Mock a query set so that it can be used with default authorization
"""
def
getlist
(
self
,
key
,
default
=
None
):
try
:
return
super
(
MockQueryDict
,
self
)
.
__getitem__
(
key
)
except
KeyError
:
if
default
is
None
:
return
[]
return
default
\ No newline at end of file
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