Commit acfcca0a by John Eskew Committed by GitHub

Merge pull request #61 from edx/jeskew/bug_fix_studentitemserializer

Print DRF errors upon invalid serialization.
parents 58d23e73 39ab9d9f
include requirements.txt
include test-requirements.txt
include tox-requirements.txt
include django-requirements.txt
include LICENSE
include AUTHORS
include README.rst
......@@ -40,6 +40,18 @@ To run the test suite:
tox # to run only a single environment, do e.g. tox -e django18
To use a Django shell to test commands:
.. code:: bash
pip install -r django-requirements.txt
pip install -r requirements.txt
pip install -r test-requirements.txt
./manage.py migrate
./manage.py shell --settings=settings
>>> from submissions.serializers import StudentItemSerializer
>>> <other commands...>
License
-------
......
......@@ -8,10 +8,14 @@ TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': 'submissions_test_db',
'NAME': 'submissions_db',
'TEST': {
'NAME': 'submissions_test_db',
}
},
'read_replica': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'submissions_read_replica_db',
'TEST': {
'MIRROR': 'default',
},
......
......@@ -46,6 +46,6 @@ setup(
'Programming Language :: Python',
],
packages=['submissions', 'submissions.migrations'],
install_requires=load_requirements('requirements.txt', 'tox-requirements.txt'),
install_requires=load_requirements('requirements.txt', 'django-requirements.txt'),
tests_require=load_requirements('test-requirements.txt'),
)
......@@ -90,6 +90,14 @@ class SubmissionRequestError(SubmissionError):
else {}
)
def __repr__(self):
"""
Show the field errors upon output.
"""
return '{}(msg="{}", field_errors={})'.format(
self.__class__.__name__, self.message, self.field_errors
)
def create_submission(student_item_dict, answer, submitted_at=None, attempt_number=None):
"""Creates a submission for assessment.
......
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