fixing tests

This commit is contained in:
Cayo Puigdefabregas 2021-05-10 11:52:43 +02:00
parent e2898b22a3
commit 882ee381b3
3 changed files with 4 additions and 6 deletions

View File

@ -119,4 +119,4 @@ def test_api_docs(client: Client):
'scheme': 'basic',
'name': 'Authorization'
}
assert len(docs['definitions']) == 119
assert len(docs['definitions']) == 120

View File

@ -413,10 +413,8 @@ def test_lot_error_add_device_from_other_user(user: UserClient):
res=Lot,
item='{}/devices'.format(parent['id']),
query=[('id', device_id)])
assert lot['devices'][0]['id'] == device_id, 'Lot contains device'
assert len(lot['devices']) == 1
with raises(JSONDecodeError):
device, _ = user.get(res=Device, item=device.devicehub_id)
assert lot['devices'] == [], 'Lot contains device'
assert len(lot['devices']) == 0
@pytest.mark.mvp

View File

@ -29,7 +29,7 @@ from ereuse_devicehub.resources.device.sync import MismatchBetweenProperties, \
from ereuse_devicehub.resources.enums import ComputerChassis, SnapshotSoftware
from ereuse_devicehub.resources.tag import Tag
from ereuse_devicehub.resources.user.models import User
from ereuse_devicehub.resources.action.views import save_json
from ereuse_devicehub.resources.action.views.snapshot import save_json
from ereuse_devicehub.resources.documents import documents
from tests.conftest import file
from tests import conftest