Commit 7b8b168f by Vik Paruchuri

Move the mockquerydict

parent a2e5bd07
......@@ -52,15 +52,3 @@ class DummySystemUser(object):
location = Location(location)
descriptor = self.modulestore.get_instance(course.id, location, depth=None)
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
......@@ -2,7 +2,8 @@ import json
from mock import Mock, MagicMock, ANY
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.open_ended_module import OpenEndedModule
......
......@@ -4,7 +4,8 @@ import json
from lxml import etree
from mock import Mock
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.open_ended_grading_classes.grading_service_module import GradingServiceError
......
OPEN_ENDED_GRADING_INTERFACE = {
'url': 'http://127.0.0.1:3033/',
'url': 'blah/',
'username': 'incorrect',
'password': 'incorrect',
'staff_grading': 'staff_grading',
......@@ -12,3 +12,15 @@ S3_INTERFACE = {
'aws_secret_key': "",
"aws_bucket_name": "",
}
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment