test_protocol_payment_summary_transfer_time.py 988 B

12345678910111213141516171819202122232425262728
  1. """payment summary detail includes transferTime"""
  2. from datetime import datetime
  3. from types import SimpleNamespace
  4. import unittest
  5. from app.services.qc_work_order_fee_summary import build_protocol_payment_summary
  6. class TestPaymentSummaryTransferTime(unittest.TestCase):
  7. def test_detail_includes_transfer_time(self):
  8. pay = SimpleNamespace(pay_mode="fq", contract_amount=10000)
  9. detail = SimpleNamespace(
  10. installment_no=1,
  11. order_num=1,
  12. create_time=datetime(2025, 9, 1, 10, 0, 0),
  13. installment_due_date="20250901",
  14. due_amount=5000,
  15. transfer_amount=5000,
  16. pay_status="yjf",
  17. transfer_time=datetime(2025, 9, 15, 9, 20, 0),
  18. )
  19. summary = build_protocol_payment_summary(pay, [detail])
  20. self.assertIsNotNone(summary)
  21. self.assertEqual(summary["paymentDetails"][0]["transferTime"], "2025-09-15 09:20:00")
  22. if __name__ == "__main__":
  23. unittest.main()