diff --git a/openedx/core/djangoapps/catalog/tests/test_utils.py b/openedx/core/djangoapps/catalog/tests/test_utils.py index 60ebb2a29e..7f47a855ca 100644 --- a/openedx/core/djangoapps/catalog/tests/test_utils.py +++ b/openedx/core/djangoapps/catalog/tests/test_utils.py @@ -66,7 +66,9 @@ class TestGetPrograms(CacheIsolationTestCase): # When called before UUIDs are cached, the function should return an # empty list and log a warning. self.assertEqual(get_programs(self.site), []) - mock_warning.assert_called_once_with('Failed to get program UUIDs from the cache.') + mock_warning.assert_called_once_with( + 'Failed to get program UUIDs from the cache for site {}.'.format(self.site.domain) + ) mock_warning.reset_mock() # Cache UUIDs for all 3 programs. diff --git a/openedx/core/djangoapps/catalog/utils.py b/openedx/core/djangoapps/catalog/utils.py index 51cf34ce11..86d4d12cff 100644 --- a/openedx/core/djangoapps/catalog/utils.py +++ b/openedx/core/djangoapps/catalog/utils.py @@ -63,7 +63,7 @@ def get_programs(site, uuid=None): return program uuids = cache.get(SITE_PROGRAM_UUIDS_CACHE_KEY_TPL.format(domain=site.domain), []) if not uuids: - logger.warning('Failed to get program UUIDs from the cache.') + logger.warning('Failed to get program UUIDs from the cache for site {}.'.format(site.domain)) programs = cache.get_many([PROGRAM_CACHE_KEY_TPL.format(uuid=uuid) for uuid in uuids]) programs = list(programs.values())