django1/django/contrib/auth/tests/utils.py

17 lines
482 B
Python

import warnings
from unittest import skipIf
from django.conf import settings
from django.utils.deprecation import RemovedInDjango21Warning
def skipIfCustomUser(test_func):
"""
Skip a test if a custom user model is in use.
"""
warnings.warn(
"django.contrib.auth.tests.utils.skipIfCustomUser is deprecated.",
RemovedInDjango21Warning, stacklevel=2)
return skipIf(settings.AUTH_USER_MODEL != 'auth.User', 'Custom user model in use')(test_func)