You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
482 B

  1. import warnings
  2. from unittest import skipIf
  3. from django.conf import settings
  4. from django.utils.deprecation import RemovedInDjango20Warning
  5. def skipIfCustomUser(test_func):
  6. """
  7. Skip a test if a custom user model is in use.
  8. """
  9. warnings.warn(
  10. "django.contrib.auth.tests.utils.skipIfCustomUser is deprecated.",
  11. RemovedInDjango20Warning, stacklevel=2)
  12. return skipIf(settings.AUTH_USER_MODEL != 'auth.User', 'Custom user model in use')(test_func)