diff options
| author | Sébastien Piquemal | 2012-02-14 10:10:04 +0200 |
|---|---|---|
| committer | Sébastien Piquemal | 2012-02-14 10:10:04 +0200 |
| commit | c04cb5145c4398cfac090ca7eef032296a04446f (patch) | |
| tree | f556b30b0af21980d599bd716a82cfc997679a6f /djangorestframework/tests/mixins.py | |
| parent | 821844bb11e5262fb0dfc2fecf2add8fe18d3210 (diff) | |
| parent | ba1e3b46998254e12578d75428669751e105735b (diff) | |
| download | django-rest-framework-c04cb5145c4398cfac090ca7eef032296a04446f.tar.bz2 | |
merged with trunk
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 3f5835aa..85c95d61 100644 --- a/djangorestframework/tests/mixins.py +++ b/djangorestframework/tests/mixins.py @@ -275,3 +275,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']) |
