'Test add_or_update_payment_method'

@patch('r2.lib.authorize.interaction.add_payment_method')
@patch('r2.lib.authorize.interaction.update_payment_method')
def test_add_or_update_payment_method(self, update_payment_method, add_payment_method):

    add_or_update_payment_method(self.user, Mock(), Mock())
    self.assertTrue(add_payment_method.called)
    self.assertFalse(update_payment_method.called)
    add_payment_method.reset_mock()
    update_payment_method.reset_mock()
    add_or_update_payment_method(self.user, Mock(), Mock(), 999)
    self.assertFalse(add_payment_method.called)
    self.assertTrue(update_payment_method.called)
