def test_canonical_url_without_preserve(self): rh = RoutingHelper("AA11AA") request = mock.Mock() request.GET = QueryDict("utm_source=foo&something=other") # Could be either slug self.assertRegex(rh.get_canonical_url(request, preserve_query=False), r"/address/[12]/")
def test_canonical_url(self): rh = RoutingHelper("CC11AA") request = mock.Mock() request.GET = QueryDict("utm_source=foo&something=other") # Could be either uprn self.assertRegex(rh.get_canonical_url(request), r"/address/10[23]/\?utm_source=foo")