File tree Expand file tree Collapse file tree 5 files changed +12
-9
lines changed
test_polymorphic_add_filtering Expand file tree Collapse file tree 5 files changed +12
-9
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 1212try :
1313 from polymorphic .models import PolymorphicModel
1414except :
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 ):
Original file line number Diff line number Diff line change 55try :
66 from polymorphic .models import PolymorphicModel
77except :
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
Original file line number Diff line number Diff line change 1010try :
1111 from polymorphic .models import PolymorphicModel
1212except :
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
Original file line number Diff line number Diff line change 3636
3737polymorphic = None
3838
39- if django .VERSION < (3 , 0 ):
39+ if django .VERSION < (3 , 1 ):
4040 try :
4141 import polymorphic
4242 except ImportError :
You can’t perform that action at this time.
0 commit comments