コード例 #1
0
 def testSolution_Minimal(self):
     from euphorie.content.solution import Solution
     solution = Solution()
     solution.description = u"<p>Test description</p>"
     solution.action_plan = u"Sample action plan"
     solution.prevention_plan = None
     solution.requirements = None
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSolution(root, solution)
     self.assertTrue(node in root)
     self.assertEqual(etree.tostring(node, pretty_print=True),
             '<solution xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
             '  <description>&lt;p&gt;Test description&lt;/p&gt;'
             '</description>\n'
             '  <action-plan>Sample action plan</action-plan>\n'
             '</solution>\n')
コード例 #2
0
ファイル: test_export.py プロジェクト: EU-OSHA/Euphorie
 def testSolution_Minimal(self):
     from euphorie.content.solution import Solution
     solution = Solution()
     solution.description = u"<p>Test description</p>"
     solution.action_plan = u"Sample action plan"
     solution.prevention_plan = None
     solution.requirements = None
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSolution(root, solution)
     self.assertTrue(node in root)
     self.assertEqual(
         etree.tostring(node, pretty_print=True),
         '<solution xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
         '  <description>&lt;p&gt;Test description&lt;/p&gt;'
         '</description>\n'
         '  <action-plan>Sample action plan</action-plan>\n'
         '</solution>\n')
コード例 #3
0
 def testSolution_Complete(self):
     from euphorie.content.solution import Solution
     solution = Solution()
     solution.description = u"<p>Tést description</p>"
     solution.action_plan = u"Sample actiøn plan"
     solution.prevention_plan = u"Sample prevention plån"
     solution.requirements = u"Requîrements"
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSolution(root, solution)
     self.assertEqual(etree.tostring(node, pretty_print=True),
             '<solution xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
             '  <description>&lt;p&gt;T&#233;st description&lt;/p&gt;'
             '</description>\n'
             '  <action-plan>Sample acti&#248;n plan</action-plan>\n'
             '  <prevention-plan>Sample prevention pl&#229;n'
             '</prevention-plan>\n'
             '  <requirements>Requ&#238;rements</requirements>\n'
             '</solution>\n')
コード例 #4
0
ファイル: test_export.py プロジェクト: EU-OSHA/Euphorie
 def testSolution_Complete(self):
     from euphorie.content.solution import Solution
     solution = Solution()
     solution.description = u"<p>Tést description</p>"
     solution.action_plan = u"Sample actiøn plan"
     solution.prevention_plan = u"Sample prevention plån"
     solution.requirements = u"Requîrements"
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSolution(root, solution)
     self.assertEqual(
         etree.tostring(node, pretty_print=True),
         '<solution xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
         '  <description>&lt;p&gt;T&#233;st description&lt;/p&gt;'
         '</description>\n'
         '  <action-plan>Sample acti&#248;n plan</action-plan>\n'
         '  <prevention-plan>Sample prevention pl&#229;n'
         '</prevention-plan>\n'
         '  <requirements>Requ&#238;rements</requirements>\n'
         '</solution>\n')