#14386: Standardize Site/RequestSite access; looser coupling of sites framework 
in
contrib
------------------------------------+---------------------------------------
          Reporter:  gabrielhurley  |         Owner:  gabrielhurley
            Status:  assigned       |     Milestone:  1.3          
         Component:  Contrib apps   |       Version:  SVN          
        Resolution:                 |      Keywords:               
             Stage:  Unreviewed     |     Has_patch:  1            
        Needs_docs:  0              |   Needs_tests:  0            
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by lukeplant):

 I will commit this shortly. I've made some tweaks to the patch, which I'll
 document here for your benefit:

 1. In the tests, settings.DEBUG should be restored to it's original value
 in a tearDown method, rather than in the test and rather than to the value
 'False'.  This is to avoid relying on assumptions about settings files or
 other code - it might be safe now, but that could change.

 2. Similarly, in the tests, Site._meta.installed should also be restored
 in the tearDown method, and again to the original value, and the test
 should set it to True if it is assuming that it is installed.

 3. According to PEP8, comments should start with a `#` followed by a space
 - the space was missing in some of the comments. Also, according to PEP8
 there should be be two lines between top level definitions in modules - a
 convention we haven't followed properly so far, but are trying to do with
 new files.

 4. I moved a tearDown method to after the setup, since they belong
 together.

 5. There was an unneeded import in one test, and a remaining unneeded
 import of Site/RequestSite in auth.views, and one in FlatPageSitemap

 6. Technically I think #13845 and #14377 should have had separate patches
 with tests. I added a test for #14377 since it was easy to do.

 7. Whitespace - we like trailing spaces removed in the Django code base.
 It's admittedly hard to see in some editors, Emacs has an option for
 seeing it.


 BTW, Trac didn't show the patch because of a bug where it fails to parse
 "\ No newline at end of file" in the patch, which wasn't your fault.

 Notwithstanding those comments, thanks for putting all this together,
 great work.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14386#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to