Ensure the value is a string, and return it as unicode.

def ensure_unicode_string(value):
    """Ensure the value is a string, and return it as unicode."""
    if not isinstance(value, six.string_types):
        raise TypeError(u'Expected string value, got: {}'.format(value))
    return six.text_type(value)