Commit 2e0beac3 by Braden MacDonald

Update some strings to reflect the new behaviour

parent 93e5a56d
...@@ -407,8 +407,8 @@ class LibraryContentDescriptor(LibraryContentFields, MakoModuleDescriptor, XmlDe ...@@ -407,8 +407,8 @@ class LibraryContentDescriptor(LibraryContentFields, MakoModuleDescriptor, XmlDe
StudioValidationMessage.WARNING, StudioValidationMessage.WARNING,
( (
ngettext( ngettext(
u'The specified libraries are configured to fetch {count} problem, ', u'The specified library is configured to fetch {count} problem, ',
u'The specified libraries are configured to fetch {count} problems, ', u'The specified library is configured to fetch {count} problems, ',
self.max_count self.max_count
) + ) +
ngettext( ngettext(
......
...@@ -104,15 +104,15 @@ class LibraryToolsService(object): ...@@ -104,15 +104,15 @@ class LibraryToolsService(object):
def update_children(self, dest_block, user_id, user_perms=None): 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 This method is to be used when the library that a LibraryContentModule
references have been updated. It will re-fetch all matching blocks from references has been updated. It will re-fetch all matching blocks from
the libraries, and copy them as children of dest_block. The children 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 will be given new block_ids, but the definition ID used should be the
exact same definition ID used in the library. exact same definition ID used in the library.
This method will update dest_block's 'source_libraries' field to store This method will update dest_block's 'source_library_version' field to
the version number of the libraries used, so we easily determine if store the version number of the libraries used, so we easily determine
dest_block is up to date or not. if dest_block is up to date or not.
""" """
if user_perms and not user_perms.can_write(dest_block.location.course_key): if user_perms and not user_perms.can_write(dest_block.location.course_key):
raise PermissionDenied() raise PermissionDenied()
...@@ -125,7 +125,7 @@ class LibraryToolsService(object): ...@@ -125,7 +125,7 @@ class LibraryToolsService(object):
library_key = dest_block.source_library_key library_key = dest_block.source_library_key
library = self._get_library(library_key) library = self._get_library(library_key)
if library is None: 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): if user_perms and not user_perms.can_read(library_key):
raise PermissionDenied() raise PermissionDenied()
filter_children = (dest_block.capa_type != ANY_CAPA_TYPE_VALUE) filter_children = (dest_block.capa_type != ANY_CAPA_TYPE_VALUE)
......
...@@ -126,14 +126,14 @@ class TestLibraryContentModule(LibraryContentTest): ...@@ -126,14 +126,14 @@ class TestLibraryContentModule(LibraryContentTest):
Test that the validation method of LibraryContent blocks can validate Test that the validation method of LibraryContent blocks can validate
the source_library setting. 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 = "" self.lc_block.source_library_id = ""
result = self.lc_block.validate() result = self.lc_block.validate()
self.assertFalse(result) # Validation fails due to at least one warning/message self.assertFalse(result) # Validation fails due to at least one warning/message
self.assertTrue(result.summary) self.assertTrue(result.summary)
self.assertEqual(StudioValidationMessage.NOT_CONFIGURED, result.summary.type) 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" self.lc_block.source_library_id = "library-v1:BAD+WOLF"
result = self.lc_block.validate() result = self.lc_block.validate()
self.assertFalse(result) # Validation fails due to at least one warning/message self.assertFalse(result) # Validation fails due to at least one warning/message
...@@ -141,7 +141,7 @@ class TestLibraryContentModule(LibraryContentTest): ...@@ -141,7 +141,7 @@ class TestLibraryContentModule(LibraryContentTest):
self.assertEqual(StudioValidationMessage.ERROR, result.summary.type) self.assertEqual(StudioValidationMessage.ERROR, result.summary.type)
self.assertIn("invalid", result.summary.text) 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) self.lc_block.source_library_id = unicode(self.library.location.library_key)
result = self.lc_block.validate() result = self.lc_block.validate()
self.assertFalse(result) # Validation fails due to at least one warning/message self.assertFalse(result) # Validation fails due to at least one warning/message
......
...@@ -219,7 +219,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest): ...@@ -219,7 +219,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
And I set Problem Type selector so "Any" And I set Problem Type selector so "Any"
Then I can see that "No matching content" warning is shown 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." "but there are only {actual} matching problems."
library_container = self._get_library_xblock_wrapper(self.unit_page.xblocks[1]) library_container = self._get_library_xblock_wrapper(self.unit_page.xblocks[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment