Commit 71547e29 by Vik Paruchuri

Added tests for selfassessment import and export (both pass)

parent b209018c
...@@ -113,3 +113,6 @@ class RoundTripTestCase(unittest.TestCase): ...@@ -113,3 +113,6 @@ class RoundTripTestCase(unittest.TestCase):
def test_full_roundtrip(self): def test_full_roundtrip(self):
self.check_export_roundtrip(DATA_DIR, "full") self.check_export_roundtrip(DATA_DIR, "full")
def test_selfassessment_roundtrip(self):
self.check_export_roundtrip(DATA_DIR,"self_assessment")
...@@ -312,9 +312,14 @@ class ImportTestCase(unittest.TestCase): ...@@ -312,9 +312,14 @@ class ImportTestCase(unittest.TestCase):
self.assertRaises(etree.XMLSyntaxError, system.process_xml, bad_xml) 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. 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')
\ No newline at end of file
<course> <course>
<chapter url_name="Overview"> <chapter url_name="Overview">
<html url_name="Welcome"/>
<selfassessment url_name="SampleQuestion"/> <selfassessment url_name="SampleQuestion"/>
</chapter> </chapter>
</course> </course>
<html>
<head>
</head>
<body>
Hello and welcome to the test course for self assessment.
</body>
</html>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<submitmessage> <submitmessage>
Thanks for your submission! Thanks for your submission!
</submitmessage> </submitmessage>
<hintmessage> <hintprompt>
Enter a hint below: Enter a hint below:
</hintmessage> </hintprompt>
</selfassessment> </selfassessment>
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