Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
bdb720d0
Commit
bdb720d0
authored
Apr 06, 2015
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #689 from edx/waheed/tnl1827-test-for-tnl-1758-fix
Added test for TNL-1758's fix.
parents
96f85915
898ba51f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
openassessment/assessment/test/test_training.py
+11
-1
No files found.
openassessment/assessment/test/test_training.py
View file @
bdb720d0
...
...
@@ -7,7 +7,7 @@ import mock
from
django.db
import
IntegrityError
from
openassessment.test_utils
import
CacheResetTest
from
openassessment.assessment.models
import
TrainingExample
from
openassessment.assessment.serializers
import
deserialize_training_examples
from
openassessment.assessment.serializers
import
deserialize_training_examples
,
serialize_training_example
class
TrainingExampleSerializerTest
(
CacheResetTest
):
...
...
@@ -171,3 +171,13 @@ class TrainingExampleSerializerTest(CacheResetTest):
# catching the integrity error)
examples
=
deserialize_training_examples
(
self
.
EXAMPLES
[:
1
],
self
.
RUBRIC
)
self
.
assertEqual
(
examples
,
[
mock_example
])
def
test_serialize_training_example_with_legacy_answer
(
self
):
"""Test that legacy answer format in training example serialized correctly"""
training_examples
=
deserialize_training_examples
(
self
.
EXAMPLES
,
self
.
RUBRIC
)
for
example
in
training_examples
:
self
.
assertIsInstance
(
example
.
answer
,
unicode
)
serialized_example
=
serialize_training_example
(
example
)
self
.
assertIsInstance
(
serialized_example
[
"answer"
],
dict
)
expected_answer_dict
=
{
'parts'
:
[{
'text'
:
example
.
answer
}]}
self
.
assertEqual
(
serialized_example
[
"answer"
],
expected_answer_dict
)
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