diff --git a/setup.py b/setup.py index 27a987c..f712027 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ def get_package_data(package): url='http://github.com/chibisov/drf-extensions', download_url='https://pypi.python.org/pypi/drf-extensions/', license='BSD', - install_requires=['djangorestframework>=3.10.3'], + install_requires=['djangorestframework>=3.10.3', 'packaging>=24.1'], description='Extensions for Django REST Framework', long_description='DRF-extensions is a collection of custom extensions for Django REST Framework', author='Asif Saif Uddin, Gennady Chibisov', diff --git a/tests_app/settings.py b/tests_app/settings.py index bc4b76c..334d9ef 100644 --- a/tests_app/settings.py +++ b/tests_app/settings.py @@ -139,7 +139,7 @@ AUTH_USER_MODEL = 'auth.User' -TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' +TEST_RUNNER = 'django.test.runner.DiscoverRunner' NOSE_ARGS = [ '--processes=%s' % multiprocessing.cpu_count(), diff --git a/tests_app/tests/functional/_concurrency/conditional_request/tests.py b/tests_app/tests/functional/_concurrency/conditional_request/tests.py index c247fb2..e99cd77 100644 --- a/tests_app/tests/functional/_concurrency/conditional_request/tests.py +++ b/tests_app/tests/functional/_concurrency/conditional_request/tests.py @@ -7,11 +7,11 @@ import json -@override_settings(ROOT_URLCONF='tests_app.tests.functional.concurrency.conditional_request.urls') +@override_settings(ROOT_URLCONF='tests_app.tests.functional._concurrency.conditional_request.urls') class BookAPITestCases(APITestCase): """ Run the conditional requests test cases. - `tox -- tests_app.tests.functional.concurrency.conditional_request.tests` + `tox -- tests_app.tests.functional._concurrency.conditional_request.tests` """ def setUp(self): # create a book diff --git a/tests_app/tests/functional/_examples/etags/remove_etag_gzip_postfix/tests.py b/tests_app/tests/functional/_examples/etags/remove_etag_gzip_postfix/tests.py index 2915641..fe9b4f7 100644 --- a/tests_app/tests/functional/_examples/etags/remove_etag_gzip_postfix/tests.py +++ b/tests_app/tests/functional/_examples/etags/remove_etag_gzip_postfix/tests.py @@ -1,7 +1,7 @@ from django.test import TestCase, override_settings -@override_settings(ROOT_URLCONF='tests_app.tests.functional.examples.etags.remove_etag_gzip_postfix.urls') +@override_settings(ROOT_URLCONF='tests_app.tests.functional._examples.etags.remove_etag_gzip_postfix.urls') class RemoveEtagGzipPostfixTest(TestCase): @override_settings(MIDDLEWARE_CLASSES=( @@ -16,7 +16,7 @@ def test_without_middleware(self): self.assertEqual(response['ETag'], '"etag_value;gzip"') @override_settings(MIDDLEWARE_CLASSES=( - 'tests_app.tests.functional.examples.etags.remove_etag_gzip_postfix.middleware.RemoveEtagGzipPostfix', + 'tests_app.tests.functional._examples.etags.remove_etag_gzip_postfix.middleware.RemoveEtagGzipPostfix', 'django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware' )) diff --git a/tests_app/tests/functional/migrations/0001_initial.py b/tests_app/tests/functional/migrations/0001_initial.py index d26d274..7bd1ee0 100644 --- a/tests_app/tests/functional/migrations/0001_initial.py +++ b/tests_app/tests/functional/migrations/0001_initial.py @@ -166,4 +166,13 @@ class Migration(migrations.Migration): name='permissions', field=models.ManyToManyField(to='functional.DefaultRouterPermissionModel'), ), + migrations.CreateModel( + name='Book', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100, default=None, blank=True, null=True)), + ('author', models.CharField(max_length=100, default=None, blank=True, null=True)), + ('issn', models.CharField(max_length=100, default=None, blank=True, null=True)), + ], + ), ] diff --git a/tests_app/tests/functional/models.py b/tests_app/tests/functional/models.py index ffe5069..075c288 100644 --- a/tests_app/tests/functional/models.py +++ b/tests_app/tests/functional/models.py @@ -8,3 +8,4 @@ from .routers.models import * from .routers.extended_default_router.models import * from .routers.nested_router_mixin.models import * +from ._concurrency.conditional_request.models import * diff --git a/tests_app/tests/unit/cache/decorators/tests.py b/tests_app/tests/unit/cache/decorators/tests.py index bd4d8b7..2a50db2 100644 --- a/tests_app/tests/unit/cache/decorators/tests.py +++ b/tests_app/tests/unit/cache/decorators/tests.py @@ -17,6 +17,7 @@ def setUp(self): super().setUp() self.request = factory.get('') self.cache = caches[extensions_api_settings.DEFAULT_USE_CACHE] + self.cache.clear() def test_should_return_response_if_it_is_not_in_cache(self): class TestView(views.APIView): diff --git a/tests_app/tests/unit/utils/tests.py b/tests_app/tests/unit/utils/tests.py index b709c13..967fcc9 100644 --- a/tests_app/tests/unit/utils/tests.py +++ b/tests_app/tests/unit/utils/tests.py @@ -33,8 +33,8 @@ def test_adds_http_prefix(self): def test_get_rest_framework_version_exotic_version(self): """See """ - with parsed_version('1.2alphaSOMETHING') as version: - self.assertEqual(version, (1, 2, 'alpha', 'SOMETHING')) + with parsed_version('1.2a2') as version: + self.assertEqual(version, (1, 2)) def test_get_rest_framework_version_normal_version(self): """See """ diff --git a/tox.ini b/tox.ini index 87d8344..770a4d1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py{36,37,38}-django{22}-drf{39,310,311,312} - py{36,37,38}-django{30}-drf{310,311,312} - py{36,37,38}-django{31}-drf{311,312} - py{36,37,38}-django{32}-drf{312} +envlist = py{37,38,39}-django{22}-drf{39,310,311,312} + py{37,38,39}-django{30}-drf{310,311,312} + py{37,38,39}-django{31}-drf{311,312} + py{37,38,39}-django{32}-drf{312} [testenv]