Fix Django 3.1 deprecation removal problems

- FieldDoesNotExist now has to be imported from django.core.exceptions
- Django docs specifically say not to import
  django.conf.global_settings, which now has the side-effect of
  triggering one of the check errors
This commit is contained in:
Jeff Bradberry
2022-02-03 14:27:13 -05:00
parent 05142a779d
commit e620bef2a5
4 changed files with 9 additions and 17 deletions

View File

@@ -2,7 +2,11 @@
import pytest
# Django
from django.core.exceptions import FieldDoesNotExist
from rest_framework.exceptions import PermissionDenied, ParseError
from awx.api.filters import FieldLookupBackend, OrderByBackend, get_field_from_path
from awx.main.models import (
AdHocCommand,
@@ -22,9 +26,6 @@ from awx.main.models import (
from awx.main.models.oauth import OAuth2Application
from awx.main.models.jobs import JobOptions
# Django
from django.db.models.fields import FieldDoesNotExist
def test_related():
field_lookup = FieldLookupBackend()