Added tests for selfassessment import and export (both pass)

This commit is contained in:
Vik Paruchuri
2012-11-06 09:17:35 -05:00
parent b209018c46
commit 71547e29da
5 changed files with 11 additions and 11 deletions

View File

@@ -113,3 +113,6 @@ class RoundTripTestCase(unittest.TestCase):
def test_full_roundtrip(self):
self.check_export_roundtrip(DATA_DIR, "full")
def test_selfassessment_roundtrip(self):
self.check_export_roundtrip(DATA_DIR,"self_assessment")

View File

@@ -312,9 +312,14 @@ class ImportTestCase(unittest.TestCase):
self.assertRaises(etree.XMLSyntaxError, system.process_xml, bad_xml)
def test_selfassessment_import_export(self):
def test_selfassessment_import(self):
'''
Check to see if definition_from_xml and definition_to_xml in self_assessment_module.py function.
'''
modulestore = XMLModuleStore(DATA_DIR, course_dirs=['self_assessment'])
sa_id = "edX/sa_test/2012_Fall"
location = Location(["i4x", "edX", "sa_test", "selfassessment", "SampleQuestion"])
sa_sample = modulestore.get_instance(sa_id, location)
self.assertEqual(sa_sample.metadata['attempts'], '10')

View File

@@ -1,6 +1,5 @@
<course>
<chapter url_name="Overview">
<html url_name="Welcome"/>
<selfassessment url_name="SampleQuestion"/>
</chapter>
</course>

View File

@@ -1,7 +0,0 @@
<html>
<head>
</head>
<body>
Hello and welcome to the test course for self assessment.
</body>
</html>

View File

@@ -8,7 +8,7 @@
<submitmessage>
Thanks for your submission!
</submitmessage>
<hintmessage>
<hintprompt>
Enter a hint below:
</hintmessage>
</hintprompt>
</selfassessment>