bigchaindb/tests/test_behaviours.py
2017-03-13 13:47:37 +01:00

18 lines
551 B
Python

import pytest
from bigchaindb.common import exceptions as exc
from bigchaindb.models import Transaction
################################################################################
# 1.1 - The asset ID of a CREATE transaction is the same as it's ID
def test_create_tx_no_asset_id(b):
tx = Transaction.create([b.me], [([b.me], 1)])
# works
Transaction.validate_structure(tx.to_dict())
# broken
tx.asset['id'] = 'b' * 64
with pytest.raises(exc.SchemaValidationError):
Transaction.validate_structure(tx.to_dict())