id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux
19698,Deleting Sites through a manager does not clear cache,ddavies@…,nobody,"When you delete a Site instance, i.e. Site.objects.get_current().delete(), the cache is cleared. However, if you delete all sites, Site.objects.all().delete(), the cache is not cleared.
def test_delete_all_sites_clears_cache(self):
""""""
When all site objects are deleted the cache should also
be cleared and get_current should raise a DoesNotExist
""""""
from django.contrib.sites.models import Site
site = Site.objects.create(domain='example.com', name='test')
self.assertIsInstance(Site.objects.get_current(), Site)
Site.objects.all().delete()
self.assertRaises(Site.DoesNotExist, Site.objects.get_current)
",Bug,new,contrib.sites,1.4,Normal,,,,Unreviewed,0,0,0,0,0,0