From a3f6d7877a2f87ac8ab2ed6fa830824f531b8474 Mon Sep 17 00:00:00 2001 From: Xavier Bustamante Talavera Date: Mon, 8 Oct 2018 12:25:28 +0200 Subject: [PATCH] Change name to title when returning lots --- ereuse_devicehub/resources/event/models.pyi | 2 +- ereuse_devicehub/resources/lot/views.py | 2 +- tests/test_lot.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ereuse_devicehub/resources/event/models.pyi b/ereuse_devicehub/resources/event/models.pyi index a3ca84be..8730fb31 100644 --- a/ereuse_devicehub/resources/event/models.pyi +++ b/ereuse_devicehub/resources/event/models.pyi @@ -31,7 +31,6 @@ class Event(Thing): error = ... # type: Column incidence = ... # type: Column description = ... # type: Column - finalized = ... # type: Column snapshot_id = ... # type: Column snapshot = ... # type: relationship author_id = ... # type: Column @@ -79,6 +78,7 @@ class EventWithOneDevice(Event): class EventWithMultipleDevices(Event): + devices = ... # type: relationship def __init__(self, id=None, name=None, incidence=None, closed=None, error=None, description=None, start_time=None, end_time=None, snapshot=None, agent=None, diff --git a/ereuse_devicehub/resources/lot/views.py b/ereuse_devicehub/resources/lot/views.py index 13bbe80c..64bc0424 100644 --- a/ereuse_devicehub/resources/lot/views.py +++ b/ereuse_devicehub/resources/lot/views.py @@ -58,7 +58,7 @@ class LotView(View): lot = Lot.query.filter_by(id=lot_id).one() node = { 'id': lot_id, - 'title': lot.name, + 'name': lot.name, 'url': lot.url.to_text(), 'closed': lot.closed, 'updated': lot.updated, diff --git a/tests/test_lot.py b/tests/test_lot.py index a9a11d85..a5d93b04 100644 --- a/tests/test_lot.py +++ b/tests/test_lot.py @@ -223,9 +223,9 @@ def test_post_add_children_view(user: UserClient): lots = user.get(res=Lot)[0]['items'] assert len(lots) == 1 - assert lots[0]['title'] == 'Parent' + assert lots[0]['name'] == 'Parent' assert len(lots[0]['nodes']) == 1 - assert lots[0]['nodes'][0]['title'] == 'Child' + assert lots[0]['nodes'][0]['name'] == 'Child' def test_lot_post_add_remove_device_view(app: Devicehub, user: UserClient):