def test_3_2(self): case_id = get_case_id_for_arn("3333333333") chargeback_update.represent_case(case_id, "Cert test3_2", config=conf) activity = get_last_activity(case_id) self.assertEqual(self.activity_merchant_represent, activity['activityType']) self.assertEqual("Cert test3_2", activity['notes'])
def test_9_2(self): case_id = get_case_id_for_arn("7777777771") chargeback_update.represent_case(case_id, "Cert test9_2", representment_amount=10071, config=conf) activity = get_last_activity(case_id) self.assertEqual(self.activity_merchant_represent, activity['activityType']) self.assertEqual(10071, activity['settlementAmount']) self.assertEqual("Cert test9_2", activity['notes'])
def test_represent_case_full(self, mock_http_put_request): mock_http_put_request.return_value = OrderedDict([ (u'@xmlns', u'http://www.vantivcnp.com/chargebacks'), (u'transactionId', u'21260530003675') ]) response = chargeback_update.represent_case(123, "test_note") args = mock_http_put_request.call_args expected_request_body = '<?xml version="1.0" encoding="utf-8"?><chargebackUpdateRequest xmlns="http://www.vantivcnp.com/chargebacks"><activityType>MERCHANT_REPRESENT</activityType><note>test_note</note></chargebackUpdateRequest>' request_body = utils.obj_to_xml(args[0][1]) self.assertEquals(args[0][0], "/chargebacks/123") self.assertEquals(request_body, expected_request_body) self.assertRegex(response["transactionId"], "\d+")
def test_represent_case_full(self): response = chargeback_update.represent_case(10000, "Test note") self.assertRegex(response["transactionId"], "\d+")