Implemented tests for sort_models.