2008-06-22 14:50:25 +08:00
|
|
|
"""
|
|
|
|
>>> from django.contrib.sites.models import Site
|
2008-07-31 17:24:16 +08:00
|
|
|
>>> from django.conf import settings
|
|
|
|
>>> Site(id=settings.SITE_ID, domain="example.com", name="example.com").save()
|
2008-08-31 03:25:40 +08:00
|
|
|
|
2008-07-31 17:24:16 +08:00
|
|
|
>>> # Make sure that get_current() does not return a deleted Site object.
|
2008-06-22 14:50:25 +08:00
|
|
|
>>> s = Site.objects.get_current()
|
2008-06-25 20:09:18 +08:00
|
|
|
>>> isinstance(s, Site)
|
|
|
|
True
|
2008-06-22 14:50:25 +08:00
|
|
|
|
|
|
|
>>> s.delete()
|
|
|
|
>>> Site.objects.get_current()
|
|
|
|
Traceback (most recent call last):
|
|
|
|
...
|
|
|
|
DoesNotExist: Site matching query does not exist.
|
|
|
|
"""
|