On Tue, Jan 3, 2017 at 1:14 AM, Aymeric Augustin <
aymeric.augus...@polytechnique.org> wrote:

> Regarding arguments, since signal receivers must accept **kwargs (that’s a
> document requirement), I think it’s acceptable for assertSignalSent to
> ignore unexpected arguments.
>

It's often the case that custom signals have particular arguments they want
when being sent, and which receivers will depend on. Having a shortcut for
saying "needs to have at least this set of arguments provided" seemed
useful to me.

For background, this was written to test signal sending in
django-registration, which does define a couple of custom signals. The code
in the PR has been incorporated into a base TestCase class in
django-registration already, and examples of how it's used can be seen in
django-registration's tests. For example, where a repeated account
activation should succeed and send a signal on the first try, but fail and
send no signal on later attempts:

https://github.com/ubernostrum/django-registration/blob/master/registration/tests/test_hmac_workflow.py#L70

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAL13Cg8kZScR1S9dPB0rovsbeUBdObHEn8DEeQzgOQ-f%2BFBq%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to