def test__attach_objects_post_save_hook( self, dispute_retrieve_mock, file_retrieve_mock, balance_transaction_retrieve_mock, charge_retrieve_mock, payment_intent_retrieve_mock, payment_method_retrieve_mock, ): dispute = Dispute.sync_from_stripe_data(FAKE_DISPUTE_III) assert dispute.id == FAKE_DISPUTE_III["id"] # assert File was retrieved correctly file_retrieve_mock.assert_called_once_with( id=FAKE_DISPUTE_III["evidence"]["receipt"], api_key=djstripe_settings.STRIPE_SECRET_KEY, expand=[], stripe_account=None, ) # assert Balance Transactions were retrieved correctly balance_transaction_retrieve_mock.assert_called_once_with( id=FAKE_DISPUTE_BALANCE_TRANSACTION["id"], api_key=djstripe_settings.STRIPE_SECRET_KEY, expand=[], stripe_account=None, )
def test___str__( self, dispute_retrieve_mock, file_retrieve_mock, balance_transaction_retrieve_mock, charge_retrieve_mock, payment_intent_retrieve_mock, payment_method_retrieve_mock, ): dispute = Dispute.sync_from_stripe_data(FAKE_DISPUTE_I) self.assertEqual(str(dispute), "$10.00 USD (Needs response) ")
def test_sync_from_stripe_data( self, dispute_retrieve_mock, file_retrieve_mock, balance_transaction_retrieve_mock, charge_retrieve_mock, payment_intent_retrieve_mock, payment_method_retrieve_mock, ): dispute = Dispute.sync_from_stripe_data(FAKE_DISPUTE_I) assert dispute.id == FAKE_DISPUTE_I["id"]
def test_get_stripe_dashboard_url( self, dispute_retrieve_mock, file_retrieve_mock, balance_transaction_retrieve_mock, charge_retrieve_mock, payment_intent_retrieve_mock, payment_method_retrieve_mock, ): dispute = Dispute.sync_from_stripe_data(FAKE_DISPUTE_I) self.assertEqual( dispute.get_stripe_dashboard_url(), f"{dispute._get_base_stripe_dashboard_url()}" f"{dispute.stripe_dashboard_item_name}/{dispute.payment_intent.id}", )