def testImage_Full(self): image = MockImage("hot stuff here", "test.gif", "image/gif") root = self.root() view = ExportSurvey(None, None) image = view.exportImage(root, image, u"Captiøn") self.assertEqual(etree.tostring(image, pretty_print=True), '<image xmlns="http://xml.simplon.biz/euphorie/survey/1.0" ' 'content-type="image/gif" filename="test.gif" ' 'caption="Captiøn">aG90IHN0dWZmIGhlcmU=\n' '</image>\n')
def testImage_Minimal(self): image = MockImage("hot stuff here") root = self.root() view = ExportSurvey(None, None) node = view.exportImage(root, image) self.assertTrue(node in root) self.assertEqual( etree.tostring(node, pretty_print=True), '<image xmlns="http://xml.simplon.biz/euphorie/survey/1.0">' 'aG90IHN0dWZmIGhlcmU=\n</image>\n')
def testImage_Full(self): image = MockImage("hot stuff here", "test.gif", "image/gif") root = self.root() view = ExportSurvey(None, None) image = view.exportImage(root, image, u"Captiøn") self.assertEqual( etree.tostring(image, pretty_print=True), '<image xmlns="http://xml.simplon.biz/euphorie/survey/1.0" ' 'content-type="image/gif" filename="test.gif" ' 'caption="Captiøn">aG90IHN0dWZmIGhlcmU=\n' '</image>\n')