Re: Test assertions for signals

2017-01-03 Thread Tim Graham
I agree with Carl's comment on the PR: "I don't think it would complicate the API too much to have a count=1 kwarg, and if count > 1 expect received_kwargs to be a list of lists instead of just a list. This keeps the API identical to what it is currently for the common case, but makes it possib

Re: Test assertions for signals

2017-01-03 Thread James Bennett
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

Re: Test assertions for signals

2017-01-03 Thread Aymeric Augustin
Hello, On 3 Jan 2017, at 09:16, James Bennett wrote: > Personally I'm against trying to do this in assertSignalSent, and would argue > for a separate assertSignalSentMultiple if that use case is deemed important > enough; coming up with a unified API that cleanly handles both the case of a >

Test assertions for signals

2017-01-03 Thread James Bennett
At DUTH this year I opened a ticket to add test-case assertions checking whether (or not) a signal was sent: https://code.djangoproject.com/ticket/27447 And corresponding PR: https://github.com/django/django/pull/7508 The PR has gotten bogged down in API design discussion, so I'd like to hash t