Commit Graph

8 Commits

Author SHA1 Message Date
Aymeric Augustin 4629668ffa Fixed #17415 -- Reset database sequence for Site's pk after creating the default site with an explicit pk. Thanks niko AT neagee net for the report, Russell and Karen for describing the fix, and Anssi for drafting the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17343 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-07 08:53:36 +00:00
Russell Keith-Magee afd040d4d3 Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
 assertEquals -> assertEqual
 failUnless -> assertTrue

For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 15:04:39 +00:00
Luke Plant 667d832e90 Fixed #14386, #8960, #10235, #10909, #10608, #13845, #14377 - standardize Site/RequestSite usage in various places.
Many thanks to gabrielhurley for putting most of this together.  Also to
bmihelac, arthurk, qingfeng, hvendelbo, petr.pulc@s-cape.cz, Hraban for
reports and some initial patches.

The patch also contains some whitespace/PEP8 fixes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13980 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-04 14:20:47 +00:00
Malcolm Tredinnick 0dd4ec654f Invalidate the appropriate SITE_CACHE entry when saving a Site model.
This avoids the problem of, for example, saving a change to the Site model in
the admin interface and then seeing the wrong instanec returned in the next
call to get_current_site().

It's still possible to end up with an inconsistent cache if update() is used to
change the Site model, but that's pretty unavoidable. It's also a slightly odd
way to update a Site model, so if you really need to do that, you can manage to
call SiteManager.clear() at the same time.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-27 04:57:33 +00:00
Jacob Kaplan-Moss f2d7ee759a Fixed #8710: removed a few stray tabs. Thanks, gkelly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 19:25:40 +00:00
Russell Keith-Magee f423dde34a Fixed #7978 -- Modified the contrib.sites tests to guarantee the initial conditions of the test match meet the requirements of the test. Thanks to Evan Schulz for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-31 09:24:16 +00:00
Russell Keith-Magee 87a704cf50 Fixed #7531 -- Modified the sites test so that user-provided initial data doesn't cause breakage when executed from within user applications. Thanks for the report, madkinder@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-25 12:09:18 +00:00
Russell Keith-Magee 1fc0077a95 Fixed #7517 -- Added code to remove Sites from the site cache when they are deleted. Thanks to Marc Fargas for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-22 06:50:25 +00:00