Пример #1
0
 def test_deprecated_redirect(self, get_current):
     get_current.return_value.domain = 'su.mo.com'
     req = self.rf.get('/en-US/')
     # Since we're rendering a template we need this to run.
     LocaleURLMiddleware().process_request(req)
     resp = deprecated_redirect(req, url='home')
     eq_(200, resp.status_code)
     doc = pq(resp.content)
     assert doc('meta[http-equiv=refresh]')
     refresh = doc('meta[http-equiv=refresh]')
     timeout, url = refresh.attr('content').split(';url=')
     eq_('10', timeout)
     eq_(reverse('home'), url)
Пример #2
0
 def test_deprecated_redirect(self, get_current):
     get_current.return_value.domain = "su.mo.com"
     req = self.rf.get("/en-US/")
     # Since we're rendering a template we need this to run.
     LocaleURLMiddleware().process_request(req)
     resp = deprecated_redirect(req, url="home")
     eq_(200, resp.status_code)
     doc = pq(resp.content)
     assert doc("meta[http-equiv=refresh]")
     refresh = doc("meta[http-equiv=refresh]")
     timeout, url = refresh.attr("content").split(";url=")
     eq_("10", timeout)
     eq_(reverse("home"), url)