Make the model mapping fix for tests generic