diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d58de00..da43049 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,7 @@ Added Fixes ----- * Fix unicode sandwich issue in cas_server.utils.update_url +* Fix DeprecationWarning about default_app_config in Django 3.2 Removed ------- diff --git a/cas_server/__init__.py b/cas_server/__init__.py index 2ac3122..d2ae852 100644 --- a/cas_server/__init__.py +++ b/cas_server/__init__.py @@ -9,9 +9,11 @@ # # (c) 2015-2016 Valentin Samir """A django CAS server application""" +import django #: version of the application VERSION = '1.3.1' -#: path the the application configuration class -default_app_config = 'cas_server.apps.CasAppConfig' +if django.VERSION < (3, 2): + #: path the the application configuration class + default_app_config = 'cas_server.apps.CasAppConfig' diff --git a/cas_server/tests/test_utils.py b/cas_server/tests/test_utils.py index 3064abf..d690724 100644 --- a/cas_server/tests/test_utils.py +++ b/cas_server/tests/test_utils.py @@ -10,6 +10,7 @@ # # (c) 2016 Valentin Samir """Tests module for utils""" +import django from django.test import TestCase, RequestFactory from django.db import connection @@ -173,10 +174,11 @@ class UtilsTestCase(TestCase): utils.import_attr('cas_server.utils.toto') with self.assertRaises(ValueError): utils.import_attr('toto') - self.assertEqual( - utils.import_attr('cas_server.default_app_config'), - 'cas_server.apps.CasAppConfig' - ) + if django.VERSION < (3, 2): + self.assertEqual( + utils.import_attr('cas_server.default_app_config'), + 'cas_server.apps.CasAppConfig' + ) self.assertEqual(utils.import_attr(utils), utils) def test_update_url(self):