forked from django-extensions/django-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Handle warnings for default_app_config (django-extensions#1654)
- they are only defined for django versions < 3.2
- Loading branch information
1 parent
912fcc8
commit a85bcac
Showing
4 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Test Compatility between different django versions""" | ||
import django | ||
import pytest | ||
|
||
import django_extensions | ||
|
||
|
||
class TestDefaultAppConfigDefinition: | ||
@pytest.mark.skipif(django.VERSION < (3, 2), reason='app config is automatically defined by django') | ||
def test_app_config_not_defined(self): | ||
assert hasattr(django_extensions, 'default_app_config') is False | ||
|
||
@pytest.mark.skipif(django.VERSION >= (3, 2), reason='app config is not automatically defined by django') | ||
def test_app_config_defined(self): | ||
assert hasattr(django_extensions, 'default_app_config') is True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
default_app_config = 'tests.testapp.apps.TestAppConfig' | ||
import django | ||
|
||
|
||
if django.VERSION < (3, 2): | ||
default_app_config = 'tests.testapp.apps.TestAppConfig' | ||
|
||
# TODO: this is a test todo |