def _url_matches(self, url, other, match_querystring=False): ''' Need to override this so we can fix querystrings breaking regex matching ''' if not match_querystring: other = other.split('?', 1)[0] if responses._is_string(url): if responses._has_unicode(url): url = responses._clean_unicode(url) if not isinstance(other, six.text_type): other = other.encode('ascii').decode('utf8') return self._url_matches_strict(url, other) elif isinstance(url, responses.Pattern) and url.match(other): return True else: return False
def _url_matches(self, url, other, match_querystring=False): """ Need to override this so we can fix querystrings breaking regex matching """ if not match_querystring: other = other.split("?", 1)[0] if responses._is_string(url): if responses._has_unicode(url): url = responses._clean_unicode(url) if not isinstance(other, str): other = other.encode("ascii").decode("utf8") return self._url_matches_strict(url, other) elif isinstance(url, responses.Pattern) and url.match(other): return True else: return False