"""Functional tests for retrieving the authorization redirect url.""" from collaborator.constants import error from tests.testutils import db, mock_auth @db.test_schema_default_seed def test_get_transferwise_profile_for_vendor(auth_client, mocker, mock_account): """Test get TransferWise profile for vendor.""" mock_auth(mocker, mock_account.id) expected_result = { "id": 1, "profile_id": 12341234, "vendor_id": 24601, "subaccount_id": None, "status": "UNVERIFIED", "active": True, "deleted_by": None, "deleted_date": None, } result = auth_client.get( "/transferwise/profile", query_string={"vendor_id": mock_account.id} ) assert result.json == expected_result assert result.status_code == 200 @db.test_schema_default_seed def test_get_transferwise_profile_for_vendor_error(auth_client, mocker): """Test get non-existent TransferWise profile for vendor.""" mock_auth(mocker, 123) expected_result = { "code": error.ERROR_CODE_PROFILE_NOT_FOUND, "message": error.ERROR_MESSAGE_PROFILE_NOT_FOUND, } result = auth_client.get("/transferwise/profile", query_string={"vendor_id": 123}) assert result.json == expected_result assert result.status_code == 404