'Helper method used to create a library. Uses the REST API.'

def _create_library(self, org='org', library='lib', display_name='Test    Library'):

    response = self.client.ajax_post(LIBRARY_REST_URL, {'org': org, 'library': library, 'display_name': display_name})
    self.assertEqual(response.status_code, 200)
    lib_info = parse_json(response)
    lib_key = CourseKey.from_string(lib_info['library_key'])
    self.assertIsInstance(lib_key, LibraryLocator)
    return lib_key
