#5979: Django tests fail if SITE_ID is not 1.
--------------------------+-------------------------------------------------
Reporter: toddobryan | Owner: nobody
Status: new | Component: Unit test system
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------+-------------------------------------------------
Changes (by gav):
* has_patch: 0 => 1
Comment:
Attaching a patch that just forces the SITE_ID to 1.
This works nicely in every case except where we may want to test multiple
sites. For someone who wants to test multiple sites (whether for
django.contrib.sites testing directly, or for a module that depends on its
behavior), they will have to do special things in the particular test's
setup methods anyway, including overwriting settings.SITE_ID via code
multiple times to test the scenario. Therefore, I think it's fine to
leave any complicated SITE_ID (and associated database content population)
to the particular tests that actually need to test multiple sites.
Also, to fix this across this test framework in a way that would allow any
random SITE_ID would add at least a few lines of clutter to
django.test.simple.run_tests (since this is where DB
construction/destruction is done, it would only execute once) or somewhere
in django.test.client.*, which would be more reset-safe but gets run
multiple times during the testing, and would therefore be inefficient and
probably misplaced. Neither of those sound worth it for something that
doesn't give the 99% case any benefit in testing, and for which there's an
easy workaround (add proper Site construction to your specific test case).
--
Ticket URL: <http://code.djangoproject.com/ticket/5979#comment:2>
Django Code <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
-~----------~----~----~----~------~----~------~--~---