Make XModuleDescriptor use __init__ from XBlock

Fixes JIRA LMS-203
This commit is contained in:
Calen Pennington
2013-06-12 16:48:49 -04:00
parent 438ac3b1a4
commit 82606a062c
25 changed files with 243 additions and 123 deletions

View File

@@ -8,14 +8,13 @@ from xmodule.modulestore import Location
from . import test_system
class HtmlModuleSubstitutionTestCase(unittest.TestCase):
location = Location(["i4x", "edX", "toy", "html", "simple_html"])
descriptor = Mock()
def test_substitution_works(self):
sample_xml = '''%%USER_ID%%'''
module_data = {'data': sample_xml}
module_system = test_system()
module = HtmlModule(module_system, self.location, self.descriptor, module_data)
module = HtmlModule(module_system, self.descriptor, module_data)
self.assertEqual(module.get_html(), str(module_system.anonymous_student_id))
@@ -26,7 +25,7 @@ class HtmlModuleSubstitutionTestCase(unittest.TestCase):
</html>
'''
module_data = {'data': sample_xml}
module = HtmlModule(test_system(), self.location, self.descriptor, module_data)
module = HtmlModule(test_system(), self.descriptor, module_data)
self.assertEqual(module.get_html(), sample_xml)
@@ -35,6 +34,6 @@ class HtmlModuleSubstitutionTestCase(unittest.TestCase):
module_data = {'data': sample_xml}
module_system = test_system()
module_system.anonymous_student_id = None
module = HtmlModule(module_system, self.location, self.descriptor, module_data)
module = HtmlModule(module_system, self.descriptor, module_data)
self.assertEqual(module.get_html(), sample_xml)