Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
fbe3d29f
Commit
fbe3d29f
authored
Feb 13, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added tests
parent
93d18651
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletions
+31
-1
cms/djangoapps/contentstore/tests/test_contentstore.py
+31
-0
cms/djangoapps/contentstore/tests/tests.py
+0
-1
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
fbe3d29f
...
@@ -27,10 +27,12 @@ from xmodule.contentstore.django import contentstore
...
@@ -27,10 +27,12 @@ from xmodule.contentstore.django import contentstore
from
xmodule.templates
import
update_templates
from
xmodule.templates
import
update_templates
from
xmodule.modulestore.xml_exporter
import
export_to_xml
from
xmodule.modulestore.xml_exporter
import
export_to_xml
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.templates
import
update_templates
from
xmodule.capa_module
import
CapaDescriptor
from
xmodule.capa_module
import
CapaDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.course_module
import
CourseDescriptor
from
xmodule.seq_module
import
SequenceDescriptor
from
xmodule.seq_module
import
SequenceDescriptor
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
TEST_DATA_MODULESTORE
=
copy
.
deepcopy
(
settings
.
MODULESTORE
)
TEST_DATA_MODULESTORE
=
copy
.
deepcopy
(
settings
.
MODULESTORE
)
TEST_DATA_MODULESTORE
[
'default'
][
'OPTIONS'
][
'fs_root'
]
=
path
(
'common/test/data'
)
TEST_DATA_MODULESTORE
[
'default'
][
'OPTIONS'
][
'fs_root'
]
=
path
(
'common/test/data'
)
...
@@ -409,3 +411,32 @@ class ContentStoreTest(ModuleStoreTestCase):
...
@@ -409,3 +411,32 @@ class ContentStoreTest(ModuleStoreTestCase):
self
.
assertIn
(
'markdown'
,
context
,
"markdown is missing from context"
)
self
.
assertIn
(
'markdown'
,
context
,
"markdown is missing from context"
)
self
.
assertIn
(
'markdown'
,
problem
.
metadata
,
"markdown is missing from metadata"
)
self
.
assertIn
(
'markdown'
,
problem
.
metadata
,
"markdown is missing from metadata"
)
self
.
assertNotIn
(
'markdown'
,
problem
.
editable_metadata_fields
,
"Markdown slipped into the editable metadata fields"
)
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
)
cms/djangoapps/contentstore/tests/tests.py
View file @
fbe3d29f
...
@@ -86,7 +86,6 @@ class ContentStoreTestCase(ModuleStoreTestCase):
...
@@ -86,7 +86,6 @@ class ContentStoreTestCase(ModuleStoreTestCase):
# Now make sure that the user is now actually activated
# Now make sure that the user is now actually activated
self
.
assertTrue
(
user
(
email
)
.
is_active
)
self
.
assertTrue
(
user
(
email
)
.
is_active
)
class
AuthTestCase
(
ContentStoreTestCase
):
class
AuthTestCase
(
ContentStoreTestCase
):
"""Check that various permissions-related things work"""
"""Check that various permissions-related things work"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment