mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Merge pull request #3946 from linovia/feature/remove_page_info_in_pagination_error_msg
Remove page information in pagination error messages
This commit is contained in:
commit
c6dadc062d
|
@ -186,7 +186,7 @@ class PageNumberPagination(BasePagination):
|
||||||
|
|
||||||
template = 'rest_framework/pagination/numbers.html'
|
template = 'rest_framework/pagination/numbers.html'
|
||||||
|
|
||||||
invalid_page_message = _('Invalid page "{page_number}": {message}.')
|
invalid_page_message = _('Invalid page.')
|
||||||
|
|
||||||
def paginate_queryset(self, queryset, request, view=None):
|
def paginate_queryset(self, queryset, request, view=None):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -113,7 +113,7 @@ class TestPaginationIntegration:
|
||||||
response = self.view(request)
|
response = self.view(request)
|
||||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||||
assert response.data == {
|
assert response.data == {
|
||||||
'detail': 'Invalid page "0": That page number is less than 1.'
|
'detail': 'Invalid page.'
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_404_not_found_for_invalid_page(self):
|
def test_404_not_found_for_invalid_page(self):
|
||||||
|
@ -121,7 +121,7 @@ class TestPaginationIntegration:
|
||||||
response = self.view(request)
|
response = self.view(request)
|
||||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||||
assert response.data == {
|
assert response.data == {
|
||||||
'detail': 'Invalid page "invalid": That page number is not an integer.'
|
'detail': 'Invalid page.'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user