From 0952596b6d18489d100054189ebb6a9d83a43999 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 19:56:23 +0000 Subject: [PATCH 1/2] [deps] Update djangorestframework requirement 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](https://github.com/encode/django-rest-framework/compare/3.12.0...3.15.2) --- updated-dependencies: - dependency-name: djangorestframework dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7e4f2938..4b0c6d92 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ platforms=['Platform Indipendent'], keywords=['django', 'rest-framework', 'gis', 'geojson'], packages=find_packages(exclude=['tests', 'tests.*']), - install_requires=['djangorestframework>=3.12,<3.15', 'django-filter>=23.5,<25.0'], + install_requires=['djangorestframework>=3.12,<3.16', 'django-filter>=23.5,<25.0'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', From 7bc771ab0200a5310f9d8581f30f06a2fe8e2355 Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Sat, 17 Aug 2024 16:23:29 +0530 Subject: [PATCH 2/2] [tests] Updated test to support restframework 3.15 --- .../test_schema_generation.py | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/tests/django_restframework_gis_tests/test_schema_generation.py b/tests/django_restframework_gis_tests/test_schema_generation.py index 89040a7f..85dc7d78 100644 --- a/tests/django_restframework_gis_tests/test_schema_generation.py +++ b/tests/django_restframework_gis_tests/test_schema_generation.py @@ -1,4 +1,6 @@ from django.test import RequestFactory, TestCase +from packaging.version import parse as parse_version +from rest_framework import VERSION as DRF_VERSION from rest_framework.generics import RetrieveAPIView from rest_framework.request import Request from rest_framework.schemas.openapi import SchemaGenerator @@ -489,28 +491,28 @@ def test_geo_json_pagination_schema(self): ) self.assertIn("features", generated_schema["properties"]) generated_schema["properties"].pop("features") - self.assertDictEqual( - generated_schema, - { - "type": "object", - "properties": { - "type": {"type": "string", "enum": ["FeatureCollection"]}, - "count": {"type": "integer", "example": 123}, - "next": { - "type": "string", - "nullable": True, - "format": "uri", - "example": "http://api.example.org/accounts/?page=4", - }, - "previous": { - "type": "string", - "nullable": True, - "format": "uri", - "example": "http://api.example.org/accounts/?page=2", - }, + expected_schema = { + "type": "object", + "properties": { + "type": {"type": "string", "enum": ["FeatureCollection"]}, + "count": {"type": "integer", "example": 123}, + "next": { + "type": "string", + "nullable": True, + "format": "uri", + "example": "http://api.example.org/accounts/?page=4", + }, + "previous": { + "type": "string", + "nullable": True, + "format": "uri", + "example": "http://api.example.org/accounts/?page=2", }, }, - ) + } + if parse_version(DRF_VERSION) >= parse_version('3.15'): + expected_schema['required'] = ['count', 'results'] + self.assertDictEqual(generated_schema, expected_schema) class TestRestFrameworkGisFiltersSchema(TestCase):