diff --git a/awx/main/tests/unit/api/test_views.py b/awx/main/tests/unit/api/test_views.py index 4c767043bb..fe1c4974dc 100644 --- a/awx/main/tests/unit/api/test_views.py +++ b/awx/main/tests/unit/api/test_views.py @@ -16,6 +16,9 @@ from awx.api.views import ( from awx.main.models import ( Host, ) +from awx.main.views import handle_error + +from rest_framework.test import APIRequestFactory @pytest.fixture @@ -25,6 +28,12 @@ def mock_response_new(mocker): return m +def test_handle_error(): + # Assure that templating of error does not raise errors + request = APIRequestFactory().get('/fooooo/') + handle_error(request) + + class TestApiRootView: def test_get_endpoints(self, mocker, mock_response_new): endpoints = [ diff --git a/awx/templates/rest_framework/base.html b/awx/templates/rest_framework/base.html index cbd761cf33..313bbec9a3 100644 --- a/awx/templates/rest_framework/base.html +++ b/awx/templates/rest_framework/base.html @@ -157,8 +157,8 @@