"""Test for track logic layer.""" from unittest.mock import MagicMock from oto import response from pricing.logic import track from pricing.models import ows_track import pytest @pytest.fixture def fixture_success(): """Get a response.""" return response.Response('ok') def test_get_track_by_track_id(monkeypatch, fixture_success): """Test getting whether user is product owner.""" monkeypatch.setattr(ows_track, 'get_track_by_track_id', MagicMock( return_value=fixture_success)) result = track.get_track_by_track_id(1) assert result assert result.message == fixture_success.message