def test_transactions_get_list_good(client):
    from functools import partial

    def get_txs_patched(conn, **args):
        """Patch `get_transactions_filtered` so that rather than return an array
            of transactions it returns an array of shims with a to_dict() method
            that reports one of the arguments passed to `get_transactions_filtered`.
            """
        return [type('', (), {'to_dict': partial(lambda a: a, arg)})
                for arg in sorted(args.items())]

    asset_id = '1' * 64

    with patch('bigchaindb.BigchainDB.get_transactions_filtered', get_txs_patched):
        url = TX_ENDPOINT + '?asset_id=' + asset_id
        assert client.get(url).json == [
            ['asset_id', asset_id],
            ['last_tx', None],
            ['operation', None]
        ]
        url = TX_ENDPOINT + '?asset_id=' + asset_id + '&operation=CREATE'
        assert client.get(url).json == [
            ['asset_id', asset_id],
            ['last_tx', None],
            ['operation', 'CREATE']
        ]
        url = TX_ENDPOINT + '?asset_id=' + asset_id + '&last_tx=true'
        assert client.get(url).json == [
            ['asset_id', asset_id],
            ['last_tx', True],
            ['operation', None]
        ]
Patch `get_transactions_filtered` so that rather than return an array
of transactions it returns an array of shims with a to_dict() method
that reports one of the arguments passed to `get_transactions_filtered`.
tests/web/test_transactions.py