Fix DeprecationWarning about default_app_config in Django 3.2

This commit is contained in:
Valentin Samir 2022-10-17 19:27:26 +02:00
parent 1209c2cc68
commit 2c1236106d
3 changed files with 11 additions and 6 deletions

View file

@ -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
-------

View file

@ -9,9 +9,11 @@
#
# (c) 2015-2016 Valentin Samir
"""A django CAS server application"""
import django
#: version of the application
VERSION = '1.3.1'
if django.VERSION < (3, 2):
#: path the the application configuration class
default_app_config = 'cas_server.apps.CasAppConfig'

View file

@ -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,6 +174,7 @@ class UtilsTestCase(TestCase):
utils.import_attr('cas_server.utils.toto')
with self.assertRaises(ValueError):
utils.import_attr('toto')
if django.VERSION < (3, 2):
self.assertEqual(
utils.import_attr('cas_server.default_app_config'),
'cas_server.apps.CasAppConfig'