'Test that we can GET /library/ to list all libraries visible to the current user.'

def test_list_libraries(self):

    libraries = [LibraryFactory.create() for _ in range(3)]
    lib_dict = dict([(lib.location.library_key, lib) for lib in libraries])
    response = self.client.get_json(LIBRARY_REST_URL)
    self.assertEqual(response.status_code, 200)
    lib_list = parse_json(response)
    self.assertEqual(len(lib_list), len(libraries))
    for entry in lib_list:
        self.assertIn('library_key', entry)
        self.assertIn('display_name', entry)
        key = CourseKey.from_string(entry['library_key'])
        self.assertIn(key, lib_dict)
        self.assertEqual(entry['display_name'], lib_dict[key].display_name)
        del lib_dict[key]
