CHANGES.txt | ●●●●● patch | view | raw | blame | history | |
pyramid/tests/test_view.py | ●●●●● patch | view | raw | blame | history | |
pyramid/view.py | ●●●●● patch | view | raw | blame | history |
CHANGES.txt
@@ -8,6 +8,9 @@ templates for the benefit of folks who cutnpaste and save to a non-UTF8 format. - ``pyramid.view.append_slash_notfound_view`` now preserves GET query parameters across redirects. 1.0b2 (2011-01-24) ================== pyramid/tests/test_view.py
@@ -392,6 +392,14 @@ self.assertEqual(response.status, '302 Found') self.assertEqual(response.location, '/abc/') def test_with_query_string(self): request = self._makeRequest(PATH_INFO='/abc', QUERY_STRING='a=1&b=2') context = ExceptionResponse() self._registerMapper(request.registry, True) response = self._callFUT(context, request) self.assertEqual(response.status, '302 Found') self.assertEqual(response.location, '/abc/?a=1&b=2') class TestAppendSlashNotFoundViewFactory(BaseTest, unittest.TestCase): def _makeOne(self, notfound_view): from pyramid.view import AppendSlashNotFoundViewFactory pyramid/view.py
@@ -481,6 +481,8 @@ slashpath = path + '/' for route in mapper.get_routes(): if route.match(slashpath) is not None: if request.environ.get('QUERY_STRING'): slashpath += '?' + request.environ['QUERY_STRING'] return HTTPFound(location=slashpath) return self.notfound_view(context, request)