コード例 #1
0
    def test_payment_delete_not_saved(self, make_payment):
        payment = Payment(
            member=self.member,
            amount=100
        )

        with self.assertRaises(AssertionError):
            payment.delete()
コード例 #2
0
    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)
コード例 #3
0
ファイル: tests.py プロジェクト: peconia/stregsystemet
    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)
コード例 #4
0
ファイル: tests.py プロジェクト: peconia/stregsystemet
    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()