From 352627b83ab6549e5951ab6934440b59fe9721e4 Mon Sep 17 00:00:00 2001 From: Scott Sadler Date: Mon, 6 Mar 2017 12:12:04 +0100 Subject: [PATCH] add test that asset id is a string --- tests/db/test_bigchain_api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/db/test_bigchain_api.py b/tests/db/test_bigchain_api.py index f56c9e5a..d2cc82eb 100644 --- a/tests/db/test_bigchain_api.py +++ b/tests/db/test_bigchain_api.py @@ -1313,3 +1313,10 @@ def test_is_new_transaction(b, genesis_block): # Tx is new because it's only found in an invalid block assert b.is_new_transaction(tx.id) assert b.is_new_transaction(tx.id, exclude_block_id=block.id) + + +def test_validate_asset_id_string(signed_transfer_tx): + from bigchaindb.common.exceptions import ValidationError + signed_transfer_tx.asset['id'] = 1 + with pytest.raises(ValidationError): + signed_transfer_tx.validate(None)