diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 38966837f9f0b331b3cafa3dccb8b41f8c42c671 (patch) | |
tree | ff79845ba8f053cc0e57ee2020acd5957cc2022e /webapp/django/contrib/sites/tests.py |
Initial Contributionv1.0
Diffstat (limited to 'webapp/django/contrib/sites/tests.py')
-rw-r--r-- | webapp/django/contrib/sites/tests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/webapp/django/contrib/sites/tests.py b/webapp/django/contrib/sites/tests.py new file mode 100644 index 0000000000..f39f7a2c82 --- /dev/null +++ b/webapp/django/contrib/sites/tests.py @@ -0,0 +1,16 @@ +""" +>>> 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 + +>>> s.delete() +>>> Site.objects.get_current() +Traceback (most recent call last): +... +DoesNotExist: Site matching query does not exist. +""" |