Пример #1
0
 def test_author_sitemap(self):
     sitemap = AuthorSitemap()
     self.assertEquals(len(sitemap.items()), 1)
     self.assertEquals(sitemap.lastmod(self.author), self.entry_2.creation_date)
     self.assertEquals(sitemap.lastmod(User.objects.create(
         username='******', email='*****@*****.**')), None)
     self.assertEquals(sitemap.location(self.author), '/authors/admin/')
Пример #2
0
 def test_author_sitemap(self):
     sitemap = AuthorSitemap()
     items = sitemap.items()
     self.assertEquals(len(items), 2)
     self.assertEquals(sitemap.lastmod(items[0]), self.entry_2.last_update)
     self.assertEquals(sitemap.lastmod(items[1]), self.entry_1.last_update)
     self.assertEquals(sitemap.priority(items[0]), '1.0')
     self.assertEquals(sitemap.priority(items[1]), '0.5')
Пример #3
0
 def test_empty_sitemap_issue_188(self):
     Entry.objects.all().delete()
     entry_sitemap = EntrySitemap()
     category_sitemap = CategorySitemap()
     author_sitemap = AuthorSitemap()
     tag_sitemap = TagSitemap()
     self.assertEquals(len(entry_sitemap.items()), 0)
     self.assertEquals(len(category_sitemap.items()), 0)
     self.assertEquals(len(author_sitemap.items()), 0)
     self.assertEquals(len(tag_sitemap.items()), 0)
Пример #4
0
 def test_empty_sitemap_issue_188(self):
     Entry.objects.all().delete()
     entry_sitemap = EntrySitemap()
     category_sitemap = CategorySitemap()
     author_sitemap = AuthorSitemap()
     tag_sitemap = TagSitemap()
     self.assertEquals(len(entry_sitemap.items()), 0)
     self.assertEquals(len(category_sitemap.items()), 0)
     self.assertEquals(len(author_sitemap.items()), 0)
     self.assertEquals(len(tag_sitemap.items()), 0)
Пример #5
0
 def test_author_sitemap(self):
     sitemap = AuthorSitemap()
     items = sitemap.items()
     self.assertEquals(len(items), 2)
     self.assertEquals(sitemap.lastmod(items[0]),
                       self.entry_2.last_update)
     self.assertEquals(sitemap.lastmod(items[1]),
                       self.entry_1.last_update)
     self.assertEquals(sitemap.priority(items[0]), '1.0')
     self.assertEquals(sitemap.priority(items[1]), '0.5')
Пример #6
0
 def test_author_sitemap(self):
     sitemap = AuthorSitemap()
     with self.assertNumQueries(1):
         items = sitemap.items()
         self.assertEqual(len(items), 2)
     self.assertEqual(
         sitemap.lastmod(items[0]).replace(microsecond=0),
         self.entry_2.last_update.replace(microsecond=0))
     self.assertEqual(
         sitemap.lastmod(items[1]).replace(microsecond=0),
         self.entry_1.last_update.replace(microsecond=0))
     self.assertEqual(sitemap.priority(items[0]), '1.0')
     self.assertEqual(sitemap.priority(items[1]), '0.5')
Пример #7
0
 def test_author_sitemap(self):
     sitemap = AuthorSitemap()
     self.assertEquals(len(sitemap.items()), 1)
     self.assertEquals(sitemap.lastmod(self.author),
                       self.entry_2.creation_date)
     self.assertEquals(sitemap.lastmod(User.objects.create(
         username='******', email='*****@*****.**')), None)
     self.assertEquals(sitemap.location(self.author), '/authors/admin/')
Пример #8
0
 def test_author_sitemap(self):
     sitemap = AuthorSitemap()
     with self.assertNumQueries(1):
         items = sitemap.items()
         self.assertEqual(len(items), 2)
     self.assertEqual(
         sitemap.lastmod(items[0]).replace(microsecond=0),
         self.entry_2.last_update.replace(microsecond=0))
     self.assertEqual(
         sitemap.lastmod(items[1]).replace(microsecond=0),
         self.entry_1.last_update.replace(microsecond=0))
     self.assertEqual(sitemap.priority(items[0]), '1.0')
     self.assertEqual(sitemap.priority(items[1]), '0.5')