1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
""""""
import unittest
import django
from django.test import TestCase
import haystack
class AppConfigCompatibilityTestCase(TestCase):
@unittest.skipIf(
django.VERSION >= (3, 2), "default_app_config is deprecated since django 3.2."
)
def testDefaultAppConfigIsDefined_whenDjangoVersionIsLessThan3_2(self):
has_default_appconfig_attr = hasattr(haystack, "default_app_config")
self.assertTrue(has_default_appconfig_attr)
@unittest.skipIf(
django.VERSION < (3, 2),
"default_app_config should be used in versions prior to django 3.2.",
)
def testDefaultAppConfigIsDefined_whenDjangoVersionIsMoreThan3_2(self):
has_default_appconfig_attr = hasattr(haystack, "default_app_config")
self.assertFalse(has_default_appconfig_attr)
|