fixed tests

This commit is contained in:
Cayo Puigdefabregas 2022-06-01 14:00:16 +02:00
parent 29313e3470
commit ea5867e32a
2 changed files with 6 additions and 4 deletions

View File

@ -60,6 +60,8 @@ def test_api_docs(client: Client):
'/inventory/lot/{lot_id}/device/', '/inventory/lot/{lot_id}/device/',
'/inventory/lot/{lot_id}/device/add/', '/inventory/lot/{lot_id}/device/add/',
'/inventory/lot/{lot_id}/trade-document/add/', '/inventory/lot/{lot_id}/trade-document/add/',
'/inventory/lot/{lot_id}/transfer/{type_id}/',
'/inventory/lot/{lot_id}/transfer/',
'/inventory/lot/{lot_id}/upload-snapshot/', '/inventory/lot/{lot_id}/upload-snapshot/',
'/inventory/tag/devices/add/', '/inventory/tag/devices/add/',
'/inventory/tag/devices/{id}/del/', '/inventory/tag/devices/{id}/del/',

View File

@ -1134,14 +1134,14 @@ def test_edit_transfer(user3: UserClientFlask):
uri = f'/inventory/lot/{lot_id}/device/' uri = f'/inventory/lot/{lot_id}/device/'
body, status = user3.get(uri) body, status = user3.get(uri)
assert status == '200 OK' assert status == '200 OK'
assert 'Transfer (Open)' not in body assert 'Transfer (<span class="text-success">Open</span>)' not in body
assert '<i class="bi bi-trash"></i> Delete Lot' in body assert '<i class="bi bi-trash"></i> Delete Lot' in body
# create new incoming lot # create new incoming lot
uri = f'/inventory/lot/{lot_id}/transfer/incoming/' uri = f'/inventory/lot/{lot_id}/transfer/incoming/'
data = {'csrf_token': generate_csrf(), 'code': 'AAA'} data = {'csrf_token': generate_csrf(), 'code': 'AAA'}
body, status = user3.post(uri, data=data) body, status = user3.post(uri, data=data)
assert 'Transfer (Open)' in body assert 'Transfer (<span class="text-success">Open</span>)' in body
assert '<i class="bi bi-trash"></i> Delete Lot' in body assert '<i class="bi bi-trash"></i> Delete Lot' in body
lot = Lot.query.filter()[1] lot = Lot.query.filter()[1]
assert lot.transfer is not None assert lot.transfer is not None
@ -1160,7 +1160,7 @@ def test_edit_transfer(user3: UserClientFlask):
assert 'Transfer updated error!' in body assert 'Transfer updated error!' in body
assert 'one one one' not in body assert 'one one one' not in body
assert '<i class="bi bi-trash"></i> Delete Lot' in body assert '<i class="bi bi-trash"></i> Delete Lot' in body
assert 'Transfer (Open)' in body assert 'Transfer (<span class="text-success">Open</span>)' in body
# # edit transfer successfully # # edit transfer successfully
data = { data = {
@ -1174,4 +1174,4 @@ def test_edit_transfer(user3: UserClientFlask):
assert 'Transfer updated successfully!' in body assert 'Transfer updated successfully!' in body
assert 'one one one' in body assert 'one one one' in body
assert '<i class="bi bi-trash"></i> Delete Lot' not in body assert '<i class="bi bi-trash"></i> Delete Lot' not in body
assert 'Transfer (Closed)' in body assert 'Transfer (<span class="text-danger">Closed</span>)' in body