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')
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')
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')