Tuesday, July 28, 2020

Re: Channels: can ApplicationCommunicator get events from my channel layer?

Hey Chris,

Did you ever figure this out? I'm running into the exact same issue.

On Sunday, June 9, 2019 at 1:14:52 AM UTC-4, Chris wrote:
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!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/90eac9ec-a429-4ce0-9241-eaf8674a4d68o%40googlegroups.com.

No comments:

Post a Comment