add unit test
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user