def test_Objecttype_sitemap(self): sitemap = ObjecttypeSitemap() self.assertEquals(len(sitemap.items()), 1) self.assertEquals(sitemap.lastmod(self.Objecttype), self.gbobject_2.creation_date) self.assertEquals(sitemap.lastmod(Objecttype.objects.create( title='New', slug='new')), None) self.assertEquals(sitemap.priority(self.Objecttype), '1.0')
def test_Objecttype_sitemap(self): sitemap = ObjecttypeSitemap() self.assertEquals(len(sitemap.items()), 1) self.assertEquals(sitemap.lastmod(self.Objecttype), self.gbobject_2.creation_date) self.assertEquals( sitemap.lastmod(Objecttype.objects.create(title='New', slug='new')), None) self.assertEquals(sitemap.priority(self.Objecttype), '1.0')
def test_Objecttype_sitemap_zero_division_error(self): Gbobject.objects.all().delete() Objecttype_sitemap = ObjecttypeSitemap() Objecttype_sitemap.items() self.assertEquals(Objecttype_sitemap.priority(self.Objecttype), '0.5')