Example #1
0
 def test_object_list_contains_metadata(self):
     response = sitemap_xml(create_request(site=self.site1))
     self.assertQuerysetEqual(response.context_data['object_list'], [
         '/',
         '/about/'
     ], transform=attrgetter('url_path'), ordered=False)
Example #2
0
 def test_object_list_is_empty_if_no_metadata(self):
     response = sitemap_xml(create_request(site=self.site2))
     self.assertQuerysetEqual(response.context_data['object_list'], [])
Example #3
0
 def test_has_proper_content_type(self):
     response = sitemap_xml(create_request(site=self.site1))
     self.assertEqual(response['Content-Type'], 'application/xml')