def test_update_returns_validation_errors(self):
        payment_method_token = "payment-token-%s" % int(round(time.time() * 1000))
        customer_id = Customer.create().customer.id
        credit_card = CreditCard.create({
            "token": payment_method_token,
            "customer_id": customer_id,
            "number": "4111111111111111",
            "expiration_date": "12/2099"
        }).credit_card

        result = PaymentMethod.create({
            "customer_id": customer_id,
            "payment_method_nonce": Nonces.PayPalFuturePayment
        })
        self.assertTrue(result.is_success)

        old_token = result.payment_method.token
        result = PayPalAccount.update(old_token, {
            "token": payment_method_token,
        })

        self.assertFalse(result.is_success)
        self.assertEquals(
            ErrorCodes.PayPalAccount.TokenIsInUse,
            result.errors.for_object("paypal_account").on("token")[0].code
        )

        result = PayPalAccount.update(old_token, {
            "token": payment_method_token,
        })

        self.assertFalse(result.is_success)
        self.assertEquals(
            ErrorCodes.PayPalAccount.TokenIsInUse,
            result.errors.for_object("paypal_account").on("token")[0].code
        )
dataset/ETHPy150Open braintree/braintree_python/tests/integration/test_paypal_account.py/TestPayPalAccount.test_update_returns_validation_errors/original