Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–90 unchanged (90 lines)
91 # Python's file API is not async compatible. A third-party library such
92 # as https://github.com/Tinche/aiofiles allows passing the file to
93 # FileResponse as an async iterator. With a sync iterator
94 # StreamingHTTPResponse triggers a warning when iterating the file.
95 # assertWarnsMessage is not async compatible, so ignore_warnings for the
96 # test.
97 @ignore_warnings(module="django.http.response")
98 async def test_file_response(self):
99 """
100 Makes sure that FileResponse works over ASGI.
101 """
102 application = get_asgi_application()
103 # Construct HTTP request.
…lines 104–766 unchanged (663 lines)

After

…lines 1–90 unchanged (90 lines)
91 # Python's file API is not async compatible. A third-party library such
92 # as https://github.com/Tinche/aiofiles allows passing the file to
93 # FileResponse as an async iterator. With a sync iterator
94 # StreamingHTTPResponse triggers a warning when iterating the file.
95 # assertWarnsMessage is not async compatible, so ignore_warnings for the
96 # test.
97 @ignore_warnings(module="django.core.handlers.asgi")
98 async def test_file_response(self):
99 """
100 Makes sure that FileResponse works over ASGI.
101 """
102 application = get_asgi_application()
103 # Construct HTTP request.
…lines 104–766 unchanged (663 lines)

Before

module
import_statement
import "import"
dotted_name
identifier "asyncio"
import_statement
import "import"
dotted_name
identifier "sys"
import_statement
import "import"
dotted_name
identifier "tempfile"
import_statement
import "import"
dotted_name
identifier "threading"
import_statement
import "import"
dotted_name
identifier "time"
import_from_statement
from "from"
dotted_name
identifier "pathlib"
import "import"
dotted_name
identifier "Path"
import_from_statement
from "from"
dotted_name
identifier "unittest"
. "."
identifier "mock"
import "import"
dotted_name
identifier "patch"
import_from_statement
from "from"
dotted_name
identifier "asgiref"
. "."
identifier "sync"
import "import"
dotted_name
identifier "sync_to_async"
import_from_statement
from "from"
dotted_name
identifier "asgiref"
. "."
identifier "testing"
import "import"
dotted_name
identifier "ApplicationCommunicator"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "contrib"
. "."
identifier "staticfiles"
. "."
identifier "handlers"
import "import"
dotted_name
identifier "ASGIStaticFilesHandler"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "asgi"
import "import"
dotted_name
identifier "get_asgi_application"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "exceptions"
import "import"
dotted_name
identifier "RequestDataTooBig"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "handlers"
. "."
identifier "asgi"
import "import"
dotted_name
identifier "ASGIHandler"
, ","
dotted_name
identifier "ASGIRequest"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "signals"
import "import"
dotted_name
identifier "request_finished"
, ","
dotted_name
identifier "request_started"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "db"
import "import"
dotted_name
identifier "close_old_connections"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "http"
import "import"
dotted_name
identifier "HttpResponse"
, ","
dotted_name
identifier "StreamingHttpResponse"
import_from_statement (+24 nodes collapsed)
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "test"
. "."
identifier "utils"
import "import"
dotted_name
identifier "captured_stderr"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "urls"
import "import"
dotted_name
identifier "path"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "utils"
. "."
identifier "http"
import "import"
dotted_name
identifier "http_date"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "views"
. "."
identifier "decorators"
. "."
identifier "csrf"
import "import"
dotted_name
identifier "csrf_exempt"
import_from_statement
from "from"
relative_import
import_prefix
. "."
dotted_name
identifier "urls"
import "import"
dotted_name
identifier "sync_waiter"
, ","
dotted_name
identifier "test_filename"
expression_statement (+25 nodes collapsed)
class_definition (+94 nodes collapsed)
decorated_definition
decorator
@ "@"
call
identifier "override_settings"
argument_list
( "("
keyword_argument
identifier "ROOT_URLCONF"
= "="
string
string_start "\""
string_content "asgi.urls"
string_end "\""
) ")"
class_definition
class "class"
identifier "ASGITest"
argument_list
( "("
identifier "SimpleTestCase"
) ")"
: ":"
block
expression_statement
assignment
identifier "async_request_factory"
= "="
call
identifier "AsyncRequestFactory"
argument_list
( "("
) ")"
function_definition (+34 nodes collapsed)
function_definition (+262 nodes collapsed)
function_definition (+133 nodes collapsed)
comment "# Python's file API is not async compatible. A third-party l"...
comment "# as https://github.com/Tinche/aiofiles allows passing the f"...
comment "# FileResponse as an async iterator. With a sync iterator"
comment "# StreamingHTTPResponse triggers a warning when iterating th"...
comment "# assertWarnsMessage is not async compatible, so ignore_warn"...
comment "# test."
decorated_definition
decorator
@ "@"
call
identifier "ignore_warnings"
argument_list
( "("
keyword_argument
identifier "module"
= "="
string
string_start "\""
string_content "django.http.response"
string_end "\""
) ")"
function_definition (+420 nodes collapsed)
decorated_definition (+440 nodes collapsed)
function_definition (+311 nodes collapsed)
function_definition (+218 nodes collapsed)
function_definition (+239 nodes collapsed)
function_definition (+423 nodes collapsed)
function_definition (+209 nodes collapsed)
function_definition (+244 nodes collapsed)
function_definition (+106 nodes collapsed)
function_definition (+160 nodes collapsed)
function_definition (+141 nodes collapsed)
function_definition (+137 nodes collapsed)
function_definition (+141 nodes collapsed)
function_definition (+121 nodes collapsed)
function_definition (+198 nodes collapsed)
function_definition (+321 nodes collapsed)
function_definition (+290 nodes collapsed)
function_definition (+729 nodes collapsed)
function_definition (+770 nodes collapsed)
function_definition (+233 nodes collapsed)
function_definition (+200 nodes collapsed)
function_definition (+489 nodes collapsed)
function_definition (+309 nodes collapsed)

After

module
import_statement
import "import"
dotted_name
identifier "asyncio"
import_statement
import "import"
dotted_name
identifier "sys"
import_statement
import "import"
dotted_name
identifier "tempfile"
import_statement
import "import"
dotted_name
identifier "threading"
import_statement
import "import"
dotted_name
identifier "time"
import_from_statement
from "from"
dotted_name
identifier "pathlib"
import "import"
dotted_name
identifier "Path"
import_from_statement
from "from"
dotted_name
identifier "unittest"
. "."
identifier "mock"
import "import"
dotted_name
identifier "patch"
import_from_statement
from "from"
dotted_name
identifier "asgiref"
. "."
identifier "sync"
import "import"
dotted_name
identifier "sync_to_async"
import_from_statement
from "from"
dotted_name
identifier "asgiref"
. "."
identifier "testing"
import "import"
dotted_name
identifier "ApplicationCommunicator"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "contrib"
. "."
identifier "staticfiles"
. "."
identifier "handlers"
import "import"
dotted_name
identifier "ASGIStaticFilesHandler"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "asgi"
import "import"
dotted_name
identifier "get_asgi_application"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "exceptions"
import "import"
dotted_name
identifier "RequestDataTooBig"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "handlers"
. "."
identifier "asgi"
import "import"
dotted_name
identifier "ASGIHandler"
, ","
dotted_name
identifier "ASGIRequest"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "core"
. "."
identifier "signals"
import "import"
dotted_name
identifier "request_finished"
, ","
dotted_name
identifier "request_started"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "db"
import "import"
dotted_name
identifier "close_old_connections"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "http"
import "import"
dotted_name
identifier "HttpResponse"
, ","
dotted_name
identifier "StreamingHttpResponse"
import_from_statement (+24 nodes collapsed)
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "test"
. "."
identifier "utils"
import "import"
dotted_name
identifier "captured_stderr"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "urls"
import "import"
dotted_name
identifier "path"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "utils"
. "."
identifier "http"
import "import"
dotted_name
identifier "http_date"
import_from_statement
from "from"
dotted_name
identifier "django"
. "."
identifier "views"
. "."
identifier "decorators"
. "."
identifier "csrf"
import "import"
dotted_name
identifier "csrf_exempt"
import_from_statement
from "from"
relative_import
import_prefix
. "."
dotted_name
identifier "urls"
import "import"
dotted_name
identifier "sync_waiter"
, ","
dotted_name
identifier "test_filename"
expression_statement (+25 nodes collapsed)
class_definition (+94 nodes collapsed)
decorated_definition
decorator
@ "@"
call
identifier "override_settings"
argument_list
( "("
keyword_argument
identifier "ROOT_URLCONF"
= "="
string
string_start "\""
string_content "asgi.urls"
string_end "\""
) ")"
class_definition
class "class"
identifier "ASGITest"
argument_list
( "("
identifier "SimpleTestCase"
) ")"
: ":"
block
expression_statement
assignment
identifier "async_request_factory"
= "="
call
identifier "AsyncRequestFactory"
argument_list
( "("
) ")"
function_definition (+34 nodes collapsed)
function_definition (+262 nodes collapsed)
function_definition (+133 nodes collapsed)
comment "# Python's file API is not async compatible. A third-party l"...
comment "# as https://github.com/Tinche/aiofiles allows passing the f"...
comment "# FileResponse as an async iterator. With a sync iterator"
comment "# StreamingHTTPResponse triggers a warning when iterating th"...
comment "# assertWarnsMessage is not async compatible, so ignore_warn"...
comment "# test."
decorated_definition
decorator
@ "@"
call
identifier "ignore_warnings"
argument_list
( "("
keyword_argument
identifier "module"
= "="
string
string_start "\""
string_content "django.core.handlers.asgi"
string_end "\""
) ")"
function_definition (+420 nodes collapsed)
decorated_definition (+440 nodes collapsed)
function_definition (+311 nodes collapsed)
function_definition (+218 nodes collapsed)
function_definition (+239 nodes collapsed)
function_definition (+423 nodes collapsed)
function_definition (+209 nodes collapsed)
function_definition (+244 nodes collapsed)
function_definition (+106 nodes collapsed)
function_definition (+160 nodes collapsed)
function_definition (+141 nodes collapsed)
function_definition (+137 nodes collapsed)
function_definition (+141 nodes collapsed)
function_definition (+121 nodes collapsed)
function_definition (+198 nodes collapsed)
function_definition (+321 nodes collapsed)
function_definition (+290 nodes collapsed)
function_definition (+729 nodes collapsed)
function_definition (+770 nodes collapsed)
function_definition (+233 nodes collapsed)
function_definition (+200 nodes collapsed)
function_definition (+489 nodes collapsed)
function_definition (+309 nodes collapsed)