"""Tests for ows-product-workflow model.""" from owsrequest import request from owsrequest.test_utils import MockOwsResponse from product_review.constants import services from product_review.models import ows_product_workflow def test_get_error_correction(mocker): """Test get error correction success response.""" product_id = 1001 corrections = {"status": "active", "release_id": product_id, "items": []} mock_response = MockOwsResponse(200, corrections) mocker.patch.object(request, "get", return_value=mock_response) result = ows_product_workflow.get_error_correction(product_id) request.get.assert_called_once_with( services.OWS_PRODUCT_WORKFLOW, f"/product/{product_id}/correction" ) assert result == corrections def test_get_error_correction_not_found(mocker): """Test get error correction success response.""" product_id = 1001 mock_response = MockOwsResponse(404, None) mocker.patch.object(request, "get", return_value=mock_response) result = ows_product_workflow.get_error_correction(product_id) request.get.assert_called_once_with( services.OWS_PRODUCT_WORKFLOW, f"/product/{product_id}/correction" ) assert result == {}