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
d894a065
Commit
d894a065
authored
Aug 22, 2013
by
lapentab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stylistic changes
parent
17591913
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
cms/djangoapps/contentstore/tests/test_contentstore.py
+13
-2
lms/djangoapps/courseware/tests/tests.py
+9
-1
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
d894a065
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
import
json
import
json
import
shutil
import
shutil
import
mock
import
mock
from
textwrap
import
dedent
from
django.test.client
import
Client
from
django.test.client
import
Client
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
django.conf
import
settings
from
django.conf
import
settings
...
@@ -314,7 +317,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -314,7 +317,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
@mock.patch
(
'xmodule.course_module.requests.get'
)
@mock.patch
(
'xmodule.course_module.requests.get'
)
def
test_import_textbook_as_content_element
(
self
,
mock_get
):
def
test_import_textbook_as_content_element
(
self
,
mock_get
):
mock_get
.
return_value
.
text
=
u'<?xml version="1.0"?>
\n
<table_of_contents>
\n
<entry page="5" page_label="ii" name="Table of Contents"/></table_of_contents>
\n
'
mock_get
.
return_value
.
text
=
dedent
(
"""
<?xml version="1.0"?><table_of_contents>
<entry page="5" page_label="ii" name="Table of Contents"/>
</table_of_contents>
"""
)
.
strip
()
module_store
=
modulestore
(
'direct'
)
module_store
=
modulestore
(
'direct'
)
import_from_xml
(
module_store
,
'common/test/data/'
,
[
'toy'
])
import_from_xml
(
module_store
,
'common/test/data/'
,
[
'toy'
])
...
@@ -850,7 +857,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
...
@@ -850,7 +857,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
@mock.patch
(
'xmodule.course_module.requests.get'
)
@mock.patch
(
'xmodule.course_module.requests.get'
)
def
test_export_course
(
self
,
mock_get
):
def
test_export_course
(
self
,
mock_get
):
mock_get
.
return_value
.
text
=
u'<?xml version="1.0"?>
\n
<table_of_contents>
\n
<entry page="5" page_label="ii" name="Table of Contents"/></table_of_contents>
\n
'
mock_get
.
return_value
.
text
=
dedent
(
"""
<?xml version="1.0"?><table_of_contents>
<entry page="5" page_label="ii" name="Table of Contents"/>
</table_of_contents>
"""
)
.
strip
()
module_store
=
modulestore
(
'direct'
)
module_store
=
modulestore
(
'direct'
)
draft_store
=
modulestore
(
'draft'
)
draft_store
=
modulestore
(
'draft'
)
...
...
lms/djangoapps/courseware/tests/tests.py
View file @
d894a065
...
@@ -4,6 +4,8 @@ Test for lms courseware app
...
@@ -4,6 +4,8 @@ Test for lms courseware app
import
random
import
random
import
mock
import
mock
from
textwrap
import
dedent
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
@@ -165,7 +167,12 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
...
@@ -165,7 +167,12 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
@mock.patch
(
'xmodule.course_module.requests.get'
)
@mock.patch
(
'xmodule.course_module.requests.get'
)
def
test_toy_textbooks_loads
(
self
,
mock_get
):
def
test_toy_textbooks_loads
(
self
,
mock_get
):
mock_get
.
return_value
.
text
=
u'<?xml version="1.0"?>
\n
<table_of_contents>
\n
<entry page="5" page_label="ii" name="Table of Contents"/></table_of_contents>
\n
'
mock_get
.
return_value
.
text
=
dedent
(
"""
<?xml version="1.0"?><table_of_contents>
<entry page="5" page_label="ii" name="Table of Contents"/>
</table_of_contents>
"""
)
.
strip
()
module_store
=
modulestore
()
module_store
=
modulestore
()
import_from_xml
(
module_store
,
TEST_DATA_DIR
,
[
'toy'
])
import_from_xml
(
module_store
,
TEST_DATA_DIR
,
[
'toy'
])
...
@@ -173,6 +180,7 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
...
@@ -173,6 +180,7 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
self
.
assertGreater
(
len
(
course
.
textbooks
),
0
)
self
.
assertGreater
(
len
(
course
.
textbooks
),
0
)
@override_settings
(
MODULESTORE
=
TEST_DATA_DRAFT_MONGO_MODULESTORE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_DRAFT_MONGO_MODULESTORE
)
class
TestDraftModuleStore
(
TestCase
):
class
TestDraftModuleStore
(
TestCase
):
def
test_get_items_with_course_items
(
self
):
def
test_get_items_with_course_items
(
self
):
...
...
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