Fixed #23039: Don't try to serialize unmanaged models in tests