コード例 #1
0
 def test_redirect(self):
     master = self.make_master(url='h:/a/b/')
     rsrc = resource.RedirectResource(master, 'foo')
     self.render_resource(rsrc, '/')
     self.assertEqual(self.request.redirected_to, 'h:/a/b/foo')
コード例 #2
0
 def test_redirect_cr_lf(self):
     master = self.make_master(url=b'h:/a/b/')
     rsrc = resource.RedirectResource(master, b'foo\r\nbar')
     self.render_resource(rsrc, b'/')
     self.assertEqual(self.request.redirected_to, b'h:/a/b/foo')