示例#1
0
 def test_prePathURL(self):
     """
     Verify that L{FakeRequest.prePathURL} returns the prepath of the
     requested URL.
     """
     req = FakeRequest(currentSegments=['a'], uri='/a/b')
     self.assertEqual(req.prePathURL(), 'http://localhost/a')
 def test_prePathURL(self):
     """
     Verify that L{FakeRequest.prePathURL} returns the prepath of the
     requested URL.
     """
     req = FakeRequest(currentSegments=['a'], uri='/a/b')
     self.assertEqual(req.prePathURL(), 'http://localhost/a')
示例#3
0
 def test_prePathURLHost(self):
     """
     Verify that L{FakeRequest.prePathURL} will turn the C{Host} header of
     the request into the netloc of the returned URL, if it's present.
     """
     req = FakeRequest(currentSegments=["a", "b"], uri="/a/b/c/", headers={"host": "foo.bar"})
     self.assertEqual(req.prePathURL(), "http://foo.bar/a/b")
示例#4
0
 def test_prePathURLHost(self):
     """
     Verify that L{FakeRequest.prePathURL} will turn the C{Host} header of
     the request into the netloc of the returned URL, if it's present.
     """
     req = FakeRequest(currentSegments=['a', 'b'],
                       uri='/a/b/c/',
                       headers={'host': 'foo.bar'})
     self.assertEqual(req.prePathURL(), 'http://foo.bar/a/b')
 def test_prePathURLHost(self):
     """
     Verify that L{FakeRequest.prePathURL} will turn the C{Host} header of
     the request into the netloc of the returned URL, if it's present.
     """
     req = FakeRequest(currentSegments=['a', 'b'],
                       uri='/a/b/c/',
                       headers={'host': 'foo.bar'})
     self.assertEqual(req.prePathURL(), 'http://foo.bar/a/b')