This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import src.shipments.service as service
|
||||
import src.models as models
|
||||
from src.main import app
|
||||
import src.messages as messages
|
||||
import src.shipments.exceptions as exceptions
|
||||
from src.auth.auth import get_current_user
|
||||
import tests.factories.shipments as shipment_factory
|
||||
|
||||
@@ -177,12 +179,11 @@ class TestShipments:
|
||||
def test_update_one_notfound(self, client, mocker, mock_session, mock_user):
|
||||
shipment_body = shipment_factory.shipment_body_factory(name='test shipment update')
|
||||
shipment_update = shipment_factory.shipment_update_factory(name='test shipment update')
|
||||
shipment_result = None
|
||||
|
||||
mock = mocker.patch.object(
|
||||
service,
|
||||
'update_one',
|
||||
return_value=shipment_result
|
||||
side_effect=exceptions.ShipmentNotFoundError(messages.Messages.not_found('shipment'))
|
||||
)
|
||||
|
||||
response = client.put('/api/shipments/2', json=shipment_body)
|
||||
@@ -235,7 +236,7 @@ class TestShipments:
|
||||
mock = mocker.patch.object(
|
||||
service,
|
||||
'delete_one',
|
||||
return_value=shipment_result
|
||||
side_effect=exceptions.ShipmentNotFoundError(messages.Messages.not_found('shipment'))
|
||||
)
|
||||
|
||||
response = client.delete('/api/shipments/2')
|
||||
|
||||
Reference in New Issue
Block a user