Skip to content

Commit 533567a

Browse files
[deps] Allow djangorestframework up to 3.15.x
Updates the requirements on [djangorestframework](https://github.com/encode/django-rest-framework) to permit the latest version. - [Release notes](https://github.com/encode/django-rest-framework/releases) - [Commits](encode/django-rest-framework@3.12.0...3.15.2) --- updated-dependencies: - dependency-name: djangorestframework dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gagan Deep <[email protected]>
1 parent 3449785 commit 533567a

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
platforms=['Platform Indipendent'],
2626
keywords=['django', 'rest-framework', 'gis', 'geojson'],
2727
packages=find_packages(exclude=['tests', 'tests.*']),
28-
install_requires=['djangorestframework>=3.12,<3.15', 'django-filter>=23.5,<25.0'],
28+
install_requires=['djangorestframework>=3.12,<3.16', 'django-filter>=23.5,<25.0'],
2929
classifiers=[
3030
'Development Status :: 4 - Beta',
3131
'Environment :: Web Environment',

tests/django_restframework_gis_tests/test_schema_generation.py

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from django.test import RequestFactory, TestCase
2+
from packaging.version import parse as parse_version
3+
from rest_framework import VERSION as DRF_VERSION
24
from rest_framework.generics import RetrieveAPIView
35
from rest_framework.request import Request
46
from rest_framework.schemas.openapi import SchemaGenerator
@@ -489,28 +491,28 @@ def test_geo_json_pagination_schema(self):
489491
)
490492
self.assertIn("features", generated_schema["properties"])
491493
generated_schema["properties"].pop("features")
492-
self.assertDictEqual(
493-
generated_schema,
494-
{
495-
"type": "object",
496-
"properties": {
497-
"type": {"type": "string", "enum": ["FeatureCollection"]},
498-
"count": {"type": "integer", "example": 123},
499-
"next": {
500-
"type": "string",
501-
"nullable": True,
502-
"format": "uri",
503-
"example": "http://api.example.org/accounts/?page=4",
504-
},
505-
"previous": {
506-
"type": "string",
507-
"nullable": True,
508-
"format": "uri",
509-
"example": "http://api.example.org/accounts/?page=2",
510-
},
494+
expected_schema = {
495+
"type": "object",
496+
"properties": {
497+
"type": {"type": "string", "enum": ["FeatureCollection"]},
498+
"count": {"type": "integer", "example": 123},
499+
"next": {
500+
"type": "string",
501+
"nullable": True,
502+
"format": "uri",
503+
"example": "http://api.example.org/accounts/?page=4",
504+
},
505+
"previous": {
506+
"type": "string",
507+
"nullable": True,
508+
"format": "uri",
509+
"example": "http://api.example.org/accounts/?page=2",
511510
},
512511
},
513-
)
512+
}
513+
if parse_version(DRF_VERSION) >= parse_version('3.15'):
514+
expected_schema['required'] = ['count', 'results']
515+
self.assertDictEqual(generated_schema, expected_schema)
514516

515517

516518
class TestRestFrameworkGisFiltersSchema(TestCase):

0 commit comments

Comments
 (0)