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()
|
|
|
|
|
|
|
|
>>> # 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.
|
|
|
|
"""
|