diff options
| author | Tom Christie | 2012-02-07 11:23:03 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-02-07 11:23:03 +0000 |
| commit | c5691cca0e5b61b6cf866f5b8085f950e4637f5a (patch) | |
| tree | a8a0c4aacd8efdf0804155f08b5a2756164720a2 /djangorestframework/tests/mixins.py | |
| parent | cbac9244ac93f50210aaf73f626366804581ee9b (diff) | |
| parent | 5b7c8658bada462996c23bd618add39d963e859f (diff) | |
| download | django-rest-framework-c5691cca0e5b61b6cf866f5b8085f950e4637f5a.tar.bz2 | |
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
Diffstat (limited to 'djangorestframework/tests/mixins.py')
| -rw-r--r-- | djangorestframework/tests/mixins.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/djangorestframework/tests/mixins.py b/djangorestframework/tests/mixins.py index a7512efc..8268fdca 100644 --- a/djangorestframework/tests/mixins.py +++ b/djangorestframework/tests/mixins.py @@ -280,3 +280,12 @@ class TestPagination(TestCase): self.assertTrue('foo=bar' in content['next']) self.assertTrue('another=something' in content['next']) self.assertTrue('page=2' in content['next']) + + def test_duplicate_parameters_are_not_created(self): + """ Regression: ensure duplicate "page" parameters are not added to + paginated URLs. So page 1 should contain ?page=2, not ?page=1&page=2 """ + request = self.req.get('/paginator/?page=1') + response = MockPaginatorView.as_view()(request) + content = json.loads(response.content) + self.assertTrue('page=2' in content['next']) + self.assertFalse('page=1' in content['next']) |
