Fix unspents endpoint

This commit is contained in:
Sylvain Bellemare 2016-12-15 05:05:02 +01:00 committed by Sylvain Bellemare
parent 09cbba8886
commit 3922b2d4fa
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ from bigchaindb import util
from bigchaindb import Bigchain
from bigchaindb.web.views.info import info_views
from bigchaindb.web.views.transactions import transaction_views
from bigchaindb.web.views.unspents import unspent_views
from bigchaindb.monitor import Monitor
@ -70,6 +71,7 @@ def create_app(*, debug=False, threads=4):
app.register_blueprint(info_views, url_prefix='/')
app.register_blueprint(transaction_views, url_prefix='/api/v1')
app.register_blueprint(unspent_views, url_prefix='/api/v1')
return app

View File

@ -5,9 +5,9 @@ UNSPENTS_ENDPOINT = '/api/v1/unspents/'
@pytest.mark.usefixtures('inputs')
def test_get_unspents_endpoint(b, client, user_vk):
expected = [u.to_uri('..') for u in b.get_owned_ids(user_vk)]
res = client.get(UNSPENTS_ENDPOINT + '?owner_after={}'.format(user_vk))
def test_get_unspents_endpoint(b, client, user_pk):
expected = [u.to_uri('..') for u in b.get_owned_ids(user_pk)]
res = client.get(UNSPENTS_ENDPOINT + '?owner_after={}'.format(user_pk))
assert expected == res.json
assert res.status_code == 200