Skip to content

Commit

Permalink
Tighten assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisfreitag committed Sep 19, 2023
1 parent 0af7254 commit c6628d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,11 +951,11 @@ def must_be_second(*args, **kwargs):
signals.post_save.connect(must_be_first)
with factory.django.mute_signals(signals.post_save):
WithSignalsFactory(post_save_signal_receiver=must_be_second)
self.handlers.do_stuff.assert_has_calls([mock.call(2)])
self.assertEqual(self.handlers.do_stuff.call_args_list, [mock.call(2)])

self.handlers.reset_mock()
WithSignalsFactory(post_save_signal_receiver=must_be_second)
self.handlers.do_stuff.assert_has_calls([mock.call(1), mock.call(2)])
self.assertEqual(self.handlers.do_stuff.call_args_list, [mock.call(1), mock.call(2)])

def test_signal_cache(self):
with factory.django.mute_signals(signals.pre_save, signals.post_save):
Expand Down

0 comments on commit c6628d9

Please sign in to comment.