def test_payment_delete_not_saved(self, make_payment): payment = Payment( member=self.member, amount=100 ) with self.assertRaises(AssertionError): payment.delete()
def test_payment_save_not_saved(self, make_payment): payment = Payment( member=self.member, amount=100 ) payment.save() make_payment.assert_called_once_with(100)
def test_payment_delete_already_saved(self, make_payment): payment = Payment(member=self.member, amount=100) payment.save() make_payment.reset_mock() payment.delete() make_payment.assert_called_once_with(-100)
def test_payment_save_already_saved(self, make_payment): payment = Payment(member=self.member, amount=100) payment.save() make_payment.reset_mock() payment.save() make_payment.assert_not_called()