Silence warning emitted in tests

The instance method `model_name` was being defined multiple times,
causing a redefinition warning.
Merge pull request #16000 from sgrif/sg-silence-warning

Silence warning emitted in tests