From a6a2714a9b844b77bcae623c461793ffb990a387 Mon Sep 17 00:00:00 2001 From: Sergio Date: Wed, 21 Jun 2017 15:45:07 -0400 Subject: [PATCH] Add note on check_accept to testing documentation (#676) When writing tests, sometimes consumers are expected to reject connections, and while there is a check_accept parameter on send_and_consume, it's not documented. This commit adds a note on the use of the parameter to the docs. --- docs/testing.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/testing.rst b/docs/testing.rst index b3f6369..32884c0 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -126,7 +126,8 @@ purpose use ``send_and_consume`` method:: client = Client() client.send_and_consume('my_internal_channel', {'value': 'my_value'}) self.assertEqual(client.receive(), {'all is': 'done'}) - + +*Note: if testing consumers that are expected to close the connection when consuming, set the ``check_accept`` parameter to False on ``send_and_consume``.* You can use ``WSClient`` for websocket related consumers. It automatically serializes JSON content, manage cookies and headers, give easy access to the session and add ability to authorize your requests.