Channels: can ApplicationCommunicator get events from my channel layer?

23 views
Skip to first unread message

Chris

unread,
Jun 9, 2019, 1:14:52 AM6/9/19
to Django users
I am writing an integration test that loads a page, which somewhere internally calls get_channel_layer().send() to my ChannelNameRouter. I want the event to be consumed and then make various assertions.

I think that I need to instantiate an ApplicationCommunicator with my application instance from routing.py, and then cause the message to be consumed by calling .receive_output(), but when I do that I get a timeout. I can also see the ApplicationCommunicator's input_queue is empty, so it seems like the message never reaches the ApplicationCommunicator. I can see the message sitting in the channel layer (InMemoryChannelLayer.channels), and my application works fine when I test it manually. But is the ApplicationCommunicator supposed to get the message from the channel layer? How can I troubleshoot where the message gets stuck?

Thank you!

Amandeep R

unread,
Jul 28, 2020, 6:08:22 PM7/28/20
to Django users
Hey Chris,

Did you ever figure this out? I'm running into the exact same issue.
Reply all
Reply to author
Forward
0 new messages