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
e59071ed
Commit
e59071ed
authored
Jan 08, 2015
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for ValueError when updating_children for non-existing library
parent
184fd01a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
cms/djangoapps/contentstore/tests/test_libraries.py
+18
-0
No files found.
cms/djangoapps/contentstore/tests/test_libraries.py
View file @
e59071ed
...
...
@@ -419,6 +419,24 @@ class TestLibraries(LibraryTestCase):
html_block
=
modulestore
()
.
get_item
(
lc_block
.
children
[
0
])
self
.
assertEqual
(
html_block
.
display_name
,
name2
)
def
test_refresh_fails_for_unknown_library
(
self
):
# Create a course:
with
modulestore
()
.
default_store
(
ModuleStoreEnum
.
Type
.
split
):
course
=
CourseFactory
.
create
()
# Add a LibraryContent block to the course:
lc_block
=
self
.
_add_library_content_block
(
course
,
self
.
lib_key
)
lc_block
=
self
.
_refresh_children
(
lc_block
)
self
.
assertEqual
(
len
(
lc_block
.
children
),
0
)
# Now, change the block settings to have an invalid library key:
resp
=
self
.
_update_item
(
lc_block
.
location
,
{
"source_libraries"
:
[[
"library-v1:NOT+FOUND"
,
None
]]},
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
with
self
.
assertRaises
(
ValueError
):
self
.
_refresh_children
(
lc_block
,
status_code_expected
=
400
)
@ddt.ddt
class
TestLibraryAccess
(
LibraryTestCase
):
...
...
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