提交
This commit is contained in:
1 parent
427bcb1551
commit
31b04575e2
247 files changed
+39284
-20367
No files matched your search
@@ -0,0 +1,45 @@
|
||||
"""协议单缴费明细保存"""
|
||||
|
||||
import unittest
|
||||
from decimal import Decimal
|
||||
|
||||
from app.crud.collection_protocol import _payment_details_payload_unchanged
|
||||
from app.models.models import BizProtocolPaymentDetail
|
||||
|
||||
|
||||
class TestPaymentDetailsPayloadUnchanged(unittest.TestCase):
|
||||
def test_unchanged_with_blocking_status(self):
|
||||
existing = [
|
||||
BizProtocolPaymentDetail(
|
||||
installment_no=1,
|
||||
pay_status="jfqrz",
|
||||
due_amount=Decimal("3000.00"),
|
||||
transfer_type="",
|
||||
),
|
||||
BizProtocolPaymentDetail(
|
||||
installment_no=2,
|
||||
pay_status="dfj",
|
||||
due_amount=Decimal("3000.00"),
|
||||
transfer_type="",
|
||||
),
|
||||
]
|
||||
incoming = [
|
||||
{"payStatus": "jfqrz", "installmentNo": 1, "dueAmount": 3000},
|
||||
{"payStatus": "dfj", "installmentNo": 2, "dueAmount": 3000},
|
||||
]
|
||||
self.assertTrue(_payment_details_payload_unchanged(existing, incoming))
|
||||
|
||||
def test_changed_due_amount(self):
|
||||
existing = [
|
||||
BizProtocolPaymentDetail(
|
||||
installment_no=1,
|
||||
pay_status="dfj",
|
||||
due_amount=Decimal("3000.00"),
|
||||
)
|
||||
]
|
||||
incoming = [{"payStatus": "dfj", "installmentNo": 1, "dueAmount": 3100}]
|
||||
self.assertFalse(_payment_details_payload_unchanged(existing, incoming))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user