Use `model_class.__name__` and compare against `XXX_MAPPING_NAMES`
# What does this PR do?

Currently, in `tests/test_modeling_common.py`, there are a lot of condition like
```python
if model_class in get_values(MODEL_MAPPING)
```
which implies in order to get this information, all models must be able to be imported, or rely on some of our mechanism to make sure the execution won't fail the program.

In some rare case, like `natten` is installed but having a incompatible version with `torch`, we will get
```bash
E           RuntimeError: Failed to import transformers.models.dinat.modeling_dinat because of the following error (look up to see its traceback):
E           Failed to import NATTEN's CPP backend. This could be due to an invalid/incomplete install. Please uninstall NATTEN (pip uninstall natten) and re-install with the correct torch build: natten.shi-labs.com.
```
even running a single test with a model (for example, `efficientformer`) that doesn't need `natten`.

This PR changes the condition to 
```python
if model_class.__name__ in get_values(MODEL_MAPPING_NAMES)
```
which gives the same results + avoid such confusing failures + potentially reduce some overhead
_The documentation is not available anymore as the PR was closed or merged._<|||||>@sgugger Is this kind of change OK for you ..? If so, I will apply the same change to other places.<|||||>The 2 failed tests are known to be flaky (for now) - Merge the PR without re-runing CI.