"""Unit tests for report_payment_group_payment schemas.""" from payment.constants.constants import REPORT_TYPE from payment.schemas.report_payment_group_payment import ( ReportPaymentGroupPaymentDetailSchema, ReportPaymentGroupPaymentDownloadSchema, ReportPaymentGroupPaymentPutSchema, ) def test_report_payment_group_payment_put_schema(): """Test ReportPaymentGroupPaymentPutSchema.""" body = { 'report_export_url': 's3://abacus-payments/1-payment-name/approval/approve.pdf', 'report_type': REPORT_TYPE.APPROVAL, } res = ReportPaymentGroupPaymentPutSchema().load(body) assert res == body def test_report_payment_group_payment_detail_schema(): """Test ReportPaymentGroupPaymentDetailSchema.""" body = { 'report_payment_group_payment_id': 1, 'payment_group_payment_id': 2, 'report_export_url': 's3://abacus-payments/1-payment-name/approval/approve.pdf', 'report_type': REPORT_TYPE.APPROVAL, } res = ReportPaymentGroupPaymentDetailSchema().dump(body) assert res.items() >= body.items() def test_report_payment_group_payment_download_schema(): """Test ReportPaymentGroupPaymentDownloadSchema.""" body = {'download_url': 'https://abacus-payments.s3.amazonaws.com/presigned'} res = ReportPaymentGroupPaymentDownloadSchema().dump(body) assert res == body