Sorry, it really should have been:
Erik Svendsen Laustsen
1

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).

Show your support

Clapping shows how much you appreciated Haki Benita’s story.