From ecf432ad78420ce340bd78826e71803c8e6cde8a Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Mon, 6 Aug 2012 11:14:11 -0400 Subject: [PATCH] Make the simple course pass roundtrip test: - add 'type' and 'points' to capa_module metadata - replace old 'title' tag with display_name --- common/lib/xmodule/xmodule/capa_module.py | 5 +++++ common/lib/xmodule/xmodule/tests/test_export.py | 2 ++ common/test/data/simple/course.xml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 833713fcde..2da44db90e 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -563,6 +563,11 @@ class CapaDescriptor(RawDescriptor): module_class = CapaModule + # Capa modules have some additional metadata: + # TODO (vshnayder): do problems have any other metadata? Do they + # actually use type and points? + metadata_attributes = RawDescriptor.metadata_attributes + ('type', 'points') + # VS[compat] # TODO (cpennington): Delete this method once all fall 2012 course are being # edited in the cms diff --git a/common/lib/xmodule/xmodule/tests/test_export.py b/common/lib/xmodule/xmodule/tests/test_export.py index 7358d89dde..9d2f33eaee 100644 --- a/common/lib/xmodule/xmodule/tests/test_export.py +++ b/common/lib/xmodule/xmodule/tests/test_export.py @@ -93,6 +93,8 @@ class RoundTripTestCase(unittest.TestCase): def test_toy_roundtrip(self): self.check_export_roundtrip(DATA_DIR, "toy") + def test_simple_roundtrip(self): + self.check_export_roundtrip(DATA_DIR, "simple") def test_full_roundtrip(self): self.check_export_roundtrip(DATA_DIR, "full") diff --git a/common/test/data/simple/course.xml b/common/test/data/simple/course.xml index 0ecc153724..86dc8df45c 100644 --- a/common/test/data/simple/course.xml +++ b/common/test/data/simple/course.xml @@ -15,7 +15,7 @@
- +