Fixing test_get_multiple_lots and test_api_docs

This commit is contained in:
nad 2020-08-18 19:19:18 +02:00
parent 5c7444dc4d
commit 6087044a5e
3 changed files with 5 additions and 6 deletions

View File

@ -129,6 +129,7 @@ class DevicesDocumentView(DeviceView):
output.headers['Content-type'] = 'text/csv' output.headers['Content-type'] = 'text/csv'
return output return output
class LotsDocumentView(LotView): class LotsDocumentView(LotView):
def find(self, args: dict): def find(self, args: dict):
query = self.query(args) query = self.query(args)

View File

@ -50,6 +50,7 @@ def test_api_docs(client: Client):
'/diy-and-gardenings/{id}/merge/', '/diy-and-gardenings/{id}/merge/',
'/documents/devices/', '/documents/devices/',
'/documents/erasures/', '/documents/erasures/',
'/documents/lots/',
'/documents/static/{filename}', '/documents/static/{filename}',
'/documents/stock/', '/documents/stock/',
'/drills/{id}/merge/', '/drills/{id}/merge/',

View File

@ -384,14 +384,11 @@ def test_lot_post_add_remove_device_view(app: Devicehub, user: UserClient):
@pytest.mark.mvp @pytest.mark.mvp
def test_get_all_lots(user: UserClient): def test_get_multiple_lots(user: UserClient):
"""Tests submitting and retreiving all lots.""" """Tests submitting and retreiving multiple lots."""
l, _ = user.post({'name': 'Lot1', 'description': 'comments1,lot1,testcomment,'}, res=Lot) l, _ = user.post({'name': 'Lot1', 'description': 'comments1,lot1,testcomment,'}, res=Lot)
l, _ = user.post({'name': 'Lot2', 'description': 'comments2,lot2,testcomment,'}, res=Lot) l, _ = user.post({'name': 'Lot2', 'description': 'comments2,lot2,testcomment,'}, res=Lot)
l, _ = user.post({'name': 'Lot3', 'description': 'comments3,lot3,testcomment,'}, res=Lot) l, _ = user.post({'name': 'Lot3', 'description': 'comments3,lot3,testcomment,'}, res=Lot)
l, _ = user.get(res=Lot) l, _ = user.get(res=Lot)
assert l['items'][0]['name'] == 'Lot1' assert len(l) == 3
assert l['items'][0]['description'] == 'comments1,lot1,testcomment,'
assert l['items'][2]['name'] == 'Lot3'
assert l['items'][2]['description'] == 'comments3,lot3,testcomment,'