Commit 2b396453 by Usman Khalid

Fixed xml tests.

TNL-708:wq
parent e6e75978
......@@ -2,7 +2,6 @@
"simple": {
"xml": [
"<rubric>",
"<prompt>Test prompt</prompt>",
"<criterion>",
"<name>Test criterion</name>",
"<prompt>Test criterion prompt</prompt>",
......@@ -11,7 +10,6 @@
"</criterion>",
"</rubric>"
],
"prompt": "Test prompt",
"feedbackprompt": null,
"criteria": [
{
......@@ -43,7 +41,6 @@
"feedback_prompt": {
"xml": [
"<rubric>",
"<prompt>Test prompt</prompt>",
"<criterion>",
"<name>Test criterion</name>",
"<prompt>Test criterion prompt</prompt>",
......@@ -53,7 +50,6 @@
"<feedbackprompt>This is the feedback prompt</feedbackprompt>",
"</rubric>"
],
"prompt": "Test prompt",
"feedbackprompt": "This is the feedback prompt",
"criteria": [
{
......@@ -93,7 +89,6 @@
"</criterion>",
"</rubric>"
],
"prompt": null,
"feedbackprompt": null,
"criteria": [
{
......@@ -125,7 +120,6 @@
"empty_prompt": {
"xml": [
"<rubric>",
"<prompt></prompt>",
"<criterion>",
"<name>Test criterion</name>",
"<prompt>Test criterion prompt</prompt>",
......@@ -134,7 +128,6 @@
"</criterion>",
"</rubric>"
],
"prompt": "",
"feedbackprompt": null,
"criteria": [
{
......@@ -166,7 +159,6 @@
"unicode": {
"xml": [
"<rubric>",
"<prompt>ՇєรՇ קг๏๓קՇ</prompt>",
"<criterion>",
"<name>𝓣𝓮𝓼𝓽 𝓬𝓻𝓲𝓽𝓮𝓻𝓲𝓸𝓷</name>",
"<prompt>Ŧɇsŧ ȼɍɨŧɇɍɨøn ꝑɍømꝑŧ</prompt>",
......@@ -175,7 +167,6 @@
"</criterion>",
"</rubric>"
],
"prompt": "ՇєรՇ קг๏๓קՇ",
"feedbackprompt": null,
"criteria": [
{
......@@ -207,7 +198,6 @@
"multiple_criteria": {
"xml": [
"<rubric>",
"<prompt>Test prompt</prompt>",
"<criterion>",
"<name>Test criterion</name>",
"<prompt>Test criterion prompt</prompt>",
......@@ -221,7 +211,6 @@
"</criterion>",
"</rubric>"
],
"prompt": "Test prompt",
"feedbackprompt": null,
"criteria": [
{
......@@ -269,7 +258,6 @@
"criterion_feedback_optional": {
"xml": [
"<rubric>",
"<prompt>Test prompt</prompt>",
"<criterion>",
"<name>Test criterion</name>",
"<prompt>Test criterion prompt</prompt>",
......@@ -283,7 +271,6 @@
"</criterion>",
"</rubric>"
],
"prompt": "Test prompt",
"feedbackprompt": null,
"criteria": [
{
......
......@@ -10,6 +10,8 @@ import pytz
import dateutil.parser
from django.test import TestCase
import ddt
from openassessment.xblock.data_conversion import create_prompts_dict
from openassessment.xblock.openassessmentblock import OpenAssessmentBlock
from openassessment.xblock.xml import (
serialize_content, parse_from_xml_str, parse_rubric_xml,
......@@ -99,6 +101,7 @@ class TestSerializeContent(TestCase):
def _configure_xblock(self, data):
self.oa_block.title = data.get('title', '')
self.oa_block.prompt = data.get('prompt')
self.oa_block.prompts = create_prompts_dict(data.get('prompt'))
self.oa_block.rubric_feedback_prompt = data.get('rubric_feedback_prompt')
self.oa_block.rubric_feedback_default_text = data.get('rubric_feedback_default_text')
self.oa_block.start = _parse_date(data.get('start'))
......@@ -361,7 +364,6 @@ class TestParseRubricFromXml(TestCase):
xml = etree.fromstring("".join(data['xml']))
rubric = parse_rubric_xml(xml)
self.assertEqual(rubric['prompt'], data['prompt'])
self.assertEqual(rubric['feedbackprompt'], data['feedbackprompt'])
self.assertEqual(rubric['criteria'], data['criteria'])
......@@ -401,7 +403,7 @@ class TestParseFromXml(TestCase):
# Check that the contents of the modified XBlock are correct
expected_fields = [
'title',
'prompt',
'prompts',
'start',
'due',
'submission_start',
......
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