'Verify no event is triggered if the save does not complete. Note that the pre_save
signal is not called in this case either, but the intent is to make it clear that this model
should never emit an event if save fails.'

@mock.patch('student.models.UserProfile.save', side_effect=IntegrityError)
def test_no_event_if_save_failed(self, _save_mock):

    self.profile.gender = 'unknown'
    with self.assertRaises(IntegrityError):
        self.profile.save()
    self.assert_no_events_were_emitted()
