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
This commit is contained in:
Russell Keith-Magee 2008-07-31 09:24:16 +00:00
parent 99e34c1846
commit f423dde34a
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,9 @@
"""
>>> # Make sure that get_current() does not return a deleted Site object.
>>> from django.contrib.sites.models import Site
>>> from django.conf import settings
>>> Site(id=settings.SITE_ID, domain="example.com", name="example.com").save()
>>> # Make sure that get_current() does not return a deleted Site object.
>>> s = Site.objects.get_current()
>>> isinstance(s, Site)
True