Update some strings to reflect the new behaviour
This commit is contained in:
@@ -407,8 +407,8 @@ class LibraryContentDescriptor(LibraryContentFields, MakoModuleDescriptor, XmlDe
|
||||
StudioValidationMessage.WARNING,
|
||||
(
|
||||
ngettext(
|
||||
u'The specified libraries are configured to fetch {count} problem, ',
|
||||
u'The specified libraries are configured to fetch {count} problems, ',
|
||||
u'The specified library is configured to fetch {count} problem, ',
|
||||
u'The specified library is configured to fetch {count} problems, ',
|
||||
self.max_count
|
||||
) +
|
||||
ngettext(
|
||||
|
||||
@@ -104,15 +104,15 @@ class LibraryToolsService(object):
|
||||
|
||||
def update_children(self, dest_block, user_id, user_perms=None):
|
||||
"""
|
||||
This method is to be used when any of the libraries that a LibraryContentModule
|
||||
references have been updated. It will re-fetch all matching blocks from
|
||||
This method is to be used when the library that a LibraryContentModule
|
||||
references has been updated. It will re-fetch all matching blocks from
|
||||
the libraries, and copy them as children of dest_block. The children
|
||||
will be given new block_ids, but the definition ID used should be the
|
||||
exact same definition ID used in the library.
|
||||
|
||||
This method will update dest_block's 'source_libraries' field to store
|
||||
the version number of the libraries used, so we easily determine if
|
||||
dest_block is up to date or not.
|
||||
This method will update dest_block's 'source_library_version' field to
|
||||
store the version number of the libraries used, so we easily determine
|
||||
if dest_block is up to date or not.
|
||||
"""
|
||||
if user_perms and not user_perms.can_write(dest_block.location.course_key):
|
||||
raise PermissionDenied()
|
||||
@@ -125,7 +125,7 @@ class LibraryToolsService(object):
|
||||
library_key = dest_block.source_library_key
|
||||
library = self._get_library(library_key)
|
||||
if library is None:
|
||||
raise ValueError("Required library not found.")
|
||||
raise ValueError("Requested library not found.")
|
||||
if user_perms and not user_perms.can_read(library_key):
|
||||
raise PermissionDenied()
|
||||
filter_children = (dest_block.capa_type != ANY_CAPA_TYPE_VALUE)
|
||||
|
||||
@@ -126,14 +126,14 @@ class TestLibraryContentModule(LibraryContentTest):
|
||||
Test that the validation method of LibraryContent blocks can validate
|
||||
the source_library setting.
|
||||
"""
|
||||
# When source_libraries is blank, the validation summary should say this block needs to be configured:
|
||||
# When source_library_id is blank, the validation summary should say this block needs to be configured:
|
||||
self.lc_block.source_library_id = ""
|
||||
result = self.lc_block.validate()
|
||||
self.assertFalse(result) # Validation fails due to at least one warning/message
|
||||
self.assertTrue(result.summary)
|
||||
self.assertEqual(StudioValidationMessage.NOT_CONFIGURED, result.summary.type)
|
||||
|
||||
# When source_libraries references a non-existent library, we should get an error:
|
||||
# When source_library_id references a non-existent library, we should get an error:
|
||||
self.lc_block.source_library_id = "library-v1:BAD+WOLF"
|
||||
result = self.lc_block.validate()
|
||||
self.assertFalse(result) # Validation fails due to at least one warning/message
|
||||
@@ -141,7 +141,7 @@ class TestLibraryContentModule(LibraryContentTest):
|
||||
self.assertEqual(StudioValidationMessage.ERROR, result.summary.type)
|
||||
self.assertIn("invalid", result.summary.text)
|
||||
|
||||
# When source_libraries is set but the block needs to be updated, the summary should say so:
|
||||
# When source_library_id is set but the block needs to be updated, the summary should say so:
|
||||
self.lc_block.source_library_id = unicode(self.library.location.library_key)
|
||||
result = self.lc_block.validate()
|
||||
self.assertFalse(result) # Validation fails due to at least one warning/message
|
||||
|
||||
@@ -219,7 +219,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
|
||||
And I set Problem Type selector so "Any"
|
||||
Then I can see that "No matching content" warning is shown
|
||||
"""
|
||||
expected_tpl = "The specified libraries are configured to fetch {count} problems, " \
|
||||
expected_tpl = "The specified library is configured to fetch {count} problems, " \
|
||||
"but there are only {actual} matching problems."
|
||||
|
||||
library_container = self._get_library_xblock_wrapper(self.unit_page.xblocks[1])
|
||||
|
||||
Reference in New Issue
Block a user