From f423dde34aa0e97dd6ae3a79d4b8f7e4991fb0a2 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 31 Jul 2008 09:24:16 +0000 Subject: [PATCH] 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 --- django/contrib/sites/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/contrib/sites/tests.py b/django/contrib/sites/tests.py index 5c38ee1b6d..f39f7a2c82 100644 --- a/django/contrib/sites/tests.py +++ b/django/contrib/sites/tests.py @@ -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