'Verify the state of an xblock_info field. If no path is provided then the root item will be verified.
If should_equal is True, assert that the current state matches the expected state, otherwise assert that they
do not match.'

def _verify_xblock_info_state(self, xblock_info, xblock_info_field, expected_state, path=None, should_equal=True):

    if path:
        direct_child_xblock_info = self._get_child_xblock_info(xblock_info, path[0])
        remaining_path = (path[1:] if (len(path) > 1) else None)
        self._verify_xblock_info_state(direct_child_xblock_info, xblock_info_field, expected_state, remaining_path, should_equal)
    elif should_equal:
        self.assertEqual(xblock_info[xblock_info_field], expected_state)
    else:
        self.assertNotEqual(xblock_info[xblock_info_field], expected_state)
