def testInitWithoutType(self): t = ViewPageTemplateFile('test.pt') t._cook_check() self.assertEqual(t.content_type, "text/html") t = ViewPageTemplateFile('testxml.pt') t._cook_check() self.assertEqual(t.content_type, "text/xml")
def testInitWithType(self): t = ViewPageTemplateFile('test.pt', content_type="text/plain") t._cook_check() self.assertEquals(t.content_type, "text/plain") t = ViewPageTemplateFile('testxml.pt', content_type="text/plain") t._cook_check() self.assertEquals(t.content_type, "text/xml")