1 min readFeb 24, 2017
When I write my own tests I usually use mock.ANY
for sender
and signal
handler.assert_called_once_with(
total=100,
sender=mock.ANY,
signal=mock.ANY,
)
sender
is something you want to check when the same signal can be raised from different models (such as pre_save
etc). signal
is redundant because the mock was called (and the handler is registered to the signal).