mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Fix equality check for AssetLinks (#825)
This commit is contained in:
parent
786635df4a
commit
eb362fd6e9
@ -541,7 +541,7 @@ class AssetLink(Asset):
|
||||
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, AssetLink) and \
|
||||
self.to_dict() == self.to_dict()
|
||||
self.to_dict() == other.to_dict()
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, link):
|
||||
|
@ -516,6 +516,16 @@ def test_cast_asset_link_to_boolean():
|
||||
assert bool(AssetLink(False)) is True
|
||||
|
||||
|
||||
def test_eq_asset_link():
|
||||
from bigchaindb.common.transaction import AssetLink
|
||||
|
||||
asset_id_1 = 'asset_1'
|
||||
asset_id_2 = 'asset_2'
|
||||
|
||||
assert AssetLink(asset_id_1) == AssetLink(asset_id_1)
|
||||
assert AssetLink(asset_id_1) != AssetLink(asset_id_2)
|
||||
|
||||
|
||||
def test_add_fulfillment_to_tx(user_ffill):
|
||||
from bigchaindb.common.transaction import Transaction, Asset
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user