Dear group,

in my tests I would like to test the processing of messages in the view.

For example:

    def test_is_message_properly_handled(self):
        # The problem: We have no `request` here!
        messages.info(request, 'Hello')
        response = self.client.get("/handling-messages-view/")
        # asserts …

This is an artificial example and I'm aware that I could submit a POST request 
and then use `follow=True` so that eventually the messages are processed. But I 
would like to setup messages and their processing independently as shown above.
The problem is that we don't have the `request` instance that is used by the 
test client.
Is this possible?

Best regards,
Carsten


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/97157990-be0a-39f4-c7d2-a3595b8e2592%40cafu.de.

Reply via email to