From 0b57efe014a360e7dcf36e897148a12c230a1247 Mon Sep 17 00:00:00 2001 From: "M@ Hardcastle" Date: Thu, 11 Aug 2016 20:31:08 -0700 Subject: [PATCH] Add test to ensure blank parameters are preserved in next link --- tests/test_pagination.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_pagination.py b/tests/test_pagination.py index f7feb4006..3d1eb9b47 100644 --- a/tests/test_pagination.py +++ b/tests/test_pagination.py @@ -108,6 +108,17 @@ class TestPaginationIntegration: 'count': 50 } + def test_additional_blank_query_params_are_preserved(self): + request = factory.get('/?foobar&page=2') + response = self.view(request) + assert response.status_code == status.HTTP_200_OK + assert response.data == { + 'results': [12, 14, 16, 18, 20], + 'previous': 'http://testserver/?foobar', + 'next': 'http://testserver/?foobar&page=3', + 'count': 50 + } + def test_404_not_found_for_zero_page(self): request = factory.get('/', {'page': '0'}) response = self.view(request)