Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

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

Closed
wants to merge 1 commit into from

4 participants

Rob Golding Claude Paroz Kiril Vladimiroff Florian Apolloner
Rob Golding

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.

Claude Paroz
Owner

Fixed in 5318783

Claude Paroz claudep closed this June 25, 2012
Kiril Vladimiroff

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.

Florian Apolloner
Owner

No, we won't fix it in 1.4, please see our backporting policy: https://docs.djangoproject.com/en/dev/internals/release-process/#supported-versions -- 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

Showing 1 unique commit by 1 author.

May 01, 2012
Fixed #17966 -- 'AttributeError: AUTH_PROFILE_MODULE' when running tests efb724b
This page is out of date. Refresh to see the latest.
1  AUTHORS
@@ -565,6 +565,7 @@ answer newbie questions, and generally made Django that much better:
565 565
     Gasper Zejn <zejn@kiberpipa.org>
566 566
     Jarek Zgoda <jarek.zgoda@gmail.com>
567 567
     Cheng Zhang
  568
+    Rob Golding <rob@robgolding.com>
568 569
 
569 570
 A big THANK YOU goes to:
570 571
 
19  django/contrib/auth/tests/models.py
@@ -5,29 +5,12 @@
5 5
     SiteProfileNotAvailable, UserManager)
6 6
 
7 7
 
8  
-@override_settings(USE_TZ=False)
  8
+@override_settings(USE_TZ=False, AUTH_PROFILE_MODULE='')
9 9
 class ProfileTestCase(TestCase):
10 10
     fixtures = ['authtestdata.json']
11 11
 
12  
-    def setUp(self):
13  
-        """Backs up the AUTH_PROFILE_MODULE"""
14  
-        self.old_AUTH_PROFILE_MODULE = getattr(settings,
15  
-                                               'AUTH_PROFILE_MODULE', None)
16  
-
17  
-    def tearDown(self):
18  
-        """Restores the AUTH_PROFILE_MODULE -- if it was not set it is deleted,
19  
-        otherwise the old value is restored"""
20  
-        if self.old_AUTH_PROFILE_MODULE is None and \
21  
-                hasattr(settings, 'AUTH_PROFILE_MODULE'):
22  
-            del settings.AUTH_PROFILE_MODULE
23  
-
24  
-        if self.old_AUTH_PROFILE_MODULE is not None:
25  
-            settings.AUTH_PROFILE_MODULE = self.old_AUTH_PROFILE_MODULE
26  
-
27 12
     def test_site_profile_not_available(self):
28 13
         # calling get_profile without AUTH_PROFILE_MODULE set
29  
-        if hasattr(settings, 'AUTH_PROFILE_MODULE'):
30  
-            del settings.AUTH_PROFILE_MODULE
31 14
         user = User.objects.get(username='testclient')
32 15
         self.assertRaises(SiteProfileNotAvailable, user.get_profile)
33 16
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.