@unittest.skipUnless(('django.contrib.sitemaps' in settings.INSTALLED_APPS), 'Sitemaps not installed in this project, nothing to test.')
def test_sitemap(self):
    'A sitemap should only show objects associated with the current site.'
    response = self.client.get('/sitemap.xml')
    self.assertContains(response, '<url><loc>http://example.com/ptests/photo/test-photo/</loc><lastmod>2011-12-23</lastmod></url>')
    self.assertNotContains(response, '<url><loc>http://example.com/ptests/photo/not-on-site-photo/</loc><lastmod>2011-12-23</lastmod></url>')
    self.assertContains(response, '<url><loc>http://example.com/ptests/gallery/test-gallery/</loc><lastmod>2011-12-23</lastmod></url>')
    self.assertNotContains(response, '<url><loc>http://example.com/ptests/gallery/not-on-site-gallery/</loc><lastmod>2011-12-23</lastmod></url>')
A sitemap should only show objects associated with the current site.
@unittest.skipUnless(('django.contrib.sitemaps' in settings.INSTALLED_APPS), 'Sitemaps not installed in this project, nothing to test.')
def test_sitemap(self):
    
    response = self.client.get('/sitemap.xml')
    self.assertContains(response, '<url><loc>http://example.com/ptests/photo/test-photo/</loc><lastmod>2011-12-23</lastmod></url>')
    self.assertNotContains(response, '<url><loc>http://example.com/ptests/photo/not-on-site-photo/</loc><lastmod>2011-12-23</lastmod></url>')
    self.assertContains(response, '<url><loc>http://example.com/ptests/gallery/test-gallery/</loc><lastmod>2011-12-23</lastmod></url>')
    self.assertNotContains(response, '<url><loc>http://example.com/ptests/gallery/not-on-site-gallery/</loc><lastmod>2011-12-23</lastmod></url>')