Exemple #1
0
 def testImage_Minimal(self):
     image = MockImage("hot stuff here")
     root = self.root()
     view = ExportSurvey(None, None)
     view.include_images = True
     node = view.exportImage(root, image)
     self.assertTrue(node in root)
     self.assertEqual(
         safe_nativestring(etree.tostring(node, pretty_print=True)),
         '<image xmlns="http://xml.simplon.biz/euphorie/survey/1.0">'
         "aG90IHN0dWZmIGhlcmU=\n</image>\n",
     )
Exemple #2
0
 def testImage_Full(self):
     image = MockImage("hot stuff here", "test.gif", "image/gif")
     root = self.root()
     view = ExportSurvey(None, None)
     view.include_images = True
     image = view.exportImage(root, image, "Captiøn")
     self.assertEqual(
         safe_nativestring(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&#xF8;n">aG90IHN0dWZmIGhlcmU=\n'
         "</image>\n",
     )