Added tests for selfassessment import and export (both pass)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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')
|
||||
@@ -1,6 +1,5 @@
|
||||
<course>
|
||||
<chapter url_name="Overview">
|
||||
<html url_name="Welcome"/>
|
||||
<selfassessment url_name="SampleQuestion"/>
|
||||
</chapter>
|
||||
</course>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
Hello and welcome to the test course for self assessment.
|
||||
</body>
|
||||
</html>
|
||||
@@ -8,7 +8,7 @@
|
||||
<submitmessage>
|
||||
Thanks for your submission!
|
||||
</submitmessage>
|
||||
<hintmessage>
|
||||
<hintprompt>
|
||||
Enter a hint below:
|
||||
</hintmessage>
|
||||
</hintprompt>
|
||||
</selfassessment>
|
||||
|
||||
Reference in New Issue
Block a user