Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
fbe3d29f
Commit
fbe3d29f
authored
12 years ago
by
Chris Dodge
Browse files
Options
Downloads
Patches
Plain Diff
added tests
parent
93d18651
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/tests/test_contentstore.py
+31
-0
31 additions, 0 deletions
cms/djangoapps/contentstore/tests/test_contentstore.py
cms/djangoapps/contentstore/tests/tests.py
+0
-1
0 additions, 1 deletion
cms/djangoapps/contentstore/tests/tests.py
with
31 additions
and
1 deletion
cms/djangoapps/contentstore/tests/test_contentstore.py
+
31
−
0
View file @
fbe3d29f
...
...
@@ -27,10 +27,12 @@ from xmodule.contentstore.django import contentstore
from
xmodule.templates
import
update_templates
from
xmodule.modulestore.xml_exporter
import
export_to_xml
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.templates
import
update_templates
from
xmodule.capa_module
import
CapaDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.seq_module
import
SequenceDescriptor
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
TEST_DATA_MODULESTORE
=
copy
.
deepcopy
(
settings
.
MODULESTORE
)
TEST_DATA_MODULESTORE
[
'
default
'
][
'
OPTIONS
'
][
'
fs_root
'
]
=
path
(
'
common/test/data
'
)
...
...
@@ -409,3 +411,32 @@ class ContentStoreTest(ModuleStoreTestCase):
self
.
assertIn
(
'
markdown
'
,
context
,
"
markdown is missing from context
"
)
self
.
assertIn
(
'
markdown
'
,
problem
.
metadata
,
"
markdown is missing from metadata
"
)
self
.
assertNotIn
(
'
markdown
'
,
problem
.
editable_metadata_fields
,
"
Markdown slipped into the editable metadata fields
"
)
class
TemplateTestCase
(
ModuleStoreTestCase
):
def
test_template_cleanup
(
self
):
ms
=
modulestore
(
'
direct
'
)
# insert a bogus template in the store
bogus_template_location
=
Location
(
'
i4x
'
,
'
edx
'
,
'
templates
'
,
'
html
'
,
'
bogus
'
)
source_template_location
=
Location
(
'
i4x
'
,
'
edx
'
,
'
templates
'
,
'
html
'
,
'
Empty
'
)
ms
.
clone_item
(
source_template_location
,
bogus_template_location
)
verify_create
=
ms
.
get_item
(
bogus_template_location
)
self
.
assertIsNotNone
(
verify_create
)
# now run cleanup
update_templates
()
# now try to find dangling template, it should not be in DB any longer
asserted
=
False
try
:
verify_create
=
ms
.
get_item
(
bogus_template_location
)
except
ItemNotFoundError
:
asserted
=
True
self
.
assertTrue
(
asserted
)
This diff is collapsed.
Click to expand it.
cms/djangoapps/contentstore/tests/tests.py
+
0
−
1
View file @
fbe3d29f
...
...
@@ -86,7 +86,6 @@ class ContentStoreTestCase(ModuleStoreTestCase):
# Now make sure that the user is now actually activated
self
.
assertTrue
(
user
(
email
).
is_active
)
class
AuthTestCase
(
ContentStoreTestCase
):
"""
Check that various permissions-related things work
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment