diff --git a/starlette/responses.py b/starlette/responses.py index 7ed28225..4032abd3 100644 --- a/starlette/responses.py +++ b/starlette/responses.py @@ -10,6 +10,9 @@ from urllib.parse import quote_plus from starlette.background import BackgroundTask from starlette.datastructures import URL, MutableHeaders +# For compat with earlier versions. +# We'll drop this with the next median release. +from starlette.templating import _TemplateResponse as TemplateResponse from starlette.types import Receive, Send try: @@ -281,8 +284,3 @@ class FileResponse(Response): ) if self.background is not None: await self.background() - - -# For compat with earlier versions. -# We'll drop this with the next median release. -from starlette.templating import _TemplateResponse as TemplateResponse diff --git a/tests/test_responses.py b/tests/test_responses.py index e2201425..84ff588a 100644 --- a/tests/test_responses.py +++ b/tests/test_responses.py @@ -11,7 +11,6 @@ from starlette.responses import ( RedirectResponse, Response, StreamingResponse, - TemplateResponse, UJSONResponse, ) from starlette.testclient import TestClient diff --git a/tests/test_templates.py b/tests/test_templates.py index f8eb6842..963624a7 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -1,4 +1,5 @@ import os + import pytest from starlette.applications import Starlette