Test against six.string_types rather than basestring