Skip to content

Commit 1fad074

Browse files
committed
tests: Enable django-polymorphic tests with django 3.0
1 parent 1d2994a commit 1fad074

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

nested_admin/tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ def suppress_warnings():
1414
"ignore",
1515
"name used for saved screenshot does not match file type",
1616
UserWarning)
17+
# These deprecation warnings were thrown in django-polymorphic as of 2.1.2
18+
warnings.filterwarnings("ignore", "django.utils.translation.ugettext", Warning)
19+
warnings.filterwarnings("ignore", "force_text", Warning)

nested_admin/tests/nested_polymorphic/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
try:
1313
from polymorphic.models import PolymorphicModel
1414
except:
15-
# Temporary until django-polymorphic supports django 3.0
16-
if django.VERSION < (3, 0):
15+
# Temporary until django-polymorphic supports django 3.1
16+
if django.VERSION < (3, 1):
1717
raise
1818
else:
1919
class PolymorphicModel(object):
@@ -24,9 +24,9 @@ class BaseNestedPolymorphicTestCase(BaseNestedAdminTestCase):
2424

2525
@classmethod
2626
def setUpClass(cls):
27-
if django.VERSION >= (3, 0):
27+
if django.VERSION >= (3, 1):
2828
raise SkipTest(
29-
'django-polymorphic not yet compatible with Django 3.0')
29+
'django-polymorphic not yet compatible with Django 3.1')
3030
super(BaseNestedPolymorphicTestCase, cls).setUpClass()
3131

3232
def get_inline_model_names(self):

nested_admin/tests/nested_polymorphic/test_polymorphic_add_filtering/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
try:
66
from polymorphic.models import PolymorphicModel
77
except:
8-
# Temporary until django-polymorphic supports django 3.0
9-
if django.VERSION < (3, 0):
8+
# Temporary until django-polymorphic supports django 3.1
9+
if django.VERSION < (3, 1):
1010
raise
1111
else:
1212
PolymorphicModel = models.Model

nested_admin/tests/nested_polymorphic/test_polymorphic_std/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
try:
1111
from polymorphic.models import PolymorphicModel
1212
except:
13-
# Temporary until django-polymorphic supports django 3.0
14-
if django.VERSION < (3, 0):
13+
# Temporary until django-polymorphic supports django 3.1
14+
if django.VERSION < (3, 1):
1515
raise
1616
else:
1717
PolymorphicModel = models.Model

nested_admin/tests/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
polymorphic = None
3838

39-
if django.VERSION < (3, 0):
39+
if django.VERSION < (3, 1):
4040
try:
4141
import polymorphic
4242
except ImportError:

0 commit comments

Comments
 (0)