'Test add_payment_method'

@patch('r2.lib.authorize.interaction.PayID.add')
@patch('r2.lib.authorize.interaction.api.create_payment_profile')
@patch('r2.lib.authorize.interaction.CustomerID.get_id')
def test_add_payment_method(self, get_id, create_payment_profile, add):

    payment_method_id = 999
    create_payment_profile.return_value = payment_method_id
    return_value = add_payment_method(self.user, Mock(), Mock())
    get_id.assert_called_once_with(self.user._id)
    self.assertTrue(create_payment_profile.called)
    self.assertTrue(add.called)
    self.assertEqual(return_value, payment_method_id)
