Skip to content

Commit

Permalink
Update testing docs examples to use as_asgi() (#1573)
Browse files Browse the repository at this point in the history
  • Loading branch information
XSPGMike committed Nov 12, 2020
1 parent cea62f2 commit c7ea04f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/topics/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ application, as shown in this example:
.. code-block:: python
from channels.testing import WebsocketCommunicator
communicator = WebsocketCommunicator(SimpleWebsocketApp, "/testws/")
communicator = WebsocketCommunicator(SimpleWebsocketApp.as_asgi(), "/testws/")
connected, subprotocol = await communicator.connect()
assert connected
# Test sending text
Expand Down Expand Up @@ -229,7 +229,7 @@ or keyword arguments in the ``scope``:
from channels.testing import WebsocketCommunicator
application = URLRouter([
url(r"^testws/(?P<message>\w+)/$", KwargsWebSocketApp),
url(r"^testws/(?P<message>\w+)/$", KwargsWebSocketApp.as_asgi()),
])
communicator = WebsocketCommunicator(application, "/testws/test/")
connected, subprotocol = await communicator.connect()
Expand Down

0 comments on commit c7ea04f

Please sign in to comment.