'Calls the course API as the specified user and checks the
output against a specified set of expected blocks.'

def get_blocks_and_check_against_expected(self, user, expected_blocks):

    block_structure = get_course_blocks(user, self.course.location, self.transformers)
    self.assertEqual(set(block_structure.get_block_keys()), set(self.get_block_key_set(self.blocks, *expected_blocks)))
