Skip to content


Fixed #17966 -- 'AttributeError: AUTH_PROFILE_MODULE' when running tests #36

wants to merge 1 commit into from

4 participants


Removed all the code which checks for settings.AUTH_PROFILE_MODULE and replaced with an extra kwarg on the override_settings decorator. Net effect is about 20 fewer lines and the test now passes.

Django member

Fixed in 5318783

@claudep claudep closed this

Am I the only who thinks that this should be released in 1.4.x!?
This issue makes it impossible to use custom AUTH_PROFILE_MODULE in 1.4 after all.

Django member

No, we won't fix it in 1.4, please see our backporting policy: -- Also it doesn't make it impossible to use the AUTH_PROFILE_MODULE, it just makes it hard to run the tests (for the contrib.auth app).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 1, 2012
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 18 deletions.
  1. +1 −0 AUTHORS
  2. +1 −18 django/contrib/auth/tests/
@@ -565,6 +565,7 @@ answer newbie questions, and generally made Django that much better:
Gasper Zejn <>
Jarek Zgoda <>
Cheng Zhang
+ Rob Golding <>
A big THANK YOU goes to:
19 django/contrib/auth/tests/
@@ -5,29 +5,12 @@
SiteProfileNotAvailable, UserManager)
+@override_settings(USE_TZ=False, AUTH_PROFILE_MODULE='')
class ProfileTestCase(TestCase):
fixtures = ['authtestdata.json']
- def setUp(self):
- """Backs up the AUTH_PROFILE_MODULE"""
- self.old_AUTH_PROFILE_MODULE = getattr(settings,
- def tearDown(self):
- """Restores the AUTH_PROFILE_MODULE -- if it was not set it is deleted,
- otherwise the old value is restored"""
- if self.old_AUTH_PROFILE_MODULE is None and \
- hasattr(settings, 'AUTH_PROFILE_MODULE'):
- del settings.AUTH_PROFILE_MODULE
- if self.old_AUTH_PROFILE_MODULE is not None:
def test_site_profile_not_available(self):
# calling get_profile without AUTH_PROFILE_MODULE set
- if hasattr(settings, 'AUTH_PROFILE_MODULE'):
- del settings.AUTH_PROFILE_MODULE
user = User.objects.get(username='testclient')
self.assertRaises(SiteProfileNotAvailable, user.get_profile)
Something went wrong with that request. Please try again.