add unit test

This commit is contained in:
Chris Dodge
2013-02-21 11:22:20 -05:00
parent 68a8587ed2
commit a7f6545cbc
2 changed files with 12 additions and 1 deletions

View File

@@ -421,6 +421,17 @@ class ContentStoreTest(ModuleStoreTestCase):
self.assertIn('markdown', problem.metadata, "markdown is missing from metadata")
self.assertNotIn('markdown', problem.editable_metadata_fields, "Markdown slipped into the editable metadata fields")
def test_import_metadata_with_attempts_empty_string(self):
import_from_xml(modulestore(), 'common/test/data/', ['simple'])
ms = modulestore('direct')
asserted = False
try:
effort = ms.get_item(Location(['i4x', 'edX', 'simple', 'problem', 'ps01-simple', None]))
except ItemNotFoundError:
asserted = True
# make sure we found the item (e.g. it didn't error while loading)
self.assertFalse(asserted)
class TemplateTestCase(ModuleStoreTestCase):

View File

@@ -15,7 +15,7 @@
<chapter name="Chapter 2">
<section name="Problem Set 1">
<sequential>
<problem type="lecture" showanswer="attempted" rerandomize="true" display_name="A simple coding problem" name="Simple coding problem" filename="ps01-simple"/>
<problem type="lecture" showanswer="attempted" rerandomize="true" display_name="A simple coding problem" name="Simple coding problem" filename="ps01-simple" url_name="ps01-simple" weight="" attempts=""/>
</sequential>
</section>
<video name="Lost Video" youtube="1.0:TBvX7HzxexQ"/>