Exemple #1
0
 def testSurvey_Minimal(self):
     surveygroup = SurveyGroup()
     surveygroup.title = "Generic sector"
     surveygroup.evaluation_algorithm = "french"
     surveygroup._setOb("standard", Survey())
     survey = surveygroup["standard"]  # Acquisition wrap
     survey.title = "Standard"
     survey.introduction = None
     survey.classification_code = None
     survey.evaluation_optional = False
     survey.language = "en-GB"
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSurvey(root, survey)
     self.assertTrue(node in root)
     self.assertEqual(
         safe_nativestring(etree.tostring(root, pretty_print=True)),
         '<root xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
         "  <survey>\n"
         "    <title>Generic sector</title>\n"
         "    <language>en-GB</language>\n"
         "    <tool_type>classic</tool_type>\n"
         "    <measures_text_handling>full</measures_text_handling>\n"
         "    <integrated_action_plan>false</integrated_action_plan>\n"
         "    <evaluation-algorithm>french</evaluation-algorithm>\n"
         "    <evaluation-optional>false</evaluation-optional>\n"
         "  </survey>\n"
         "</root>\n",
     )
Exemple #2
0
 def testSurvey_Minimal(self):
     from euphorie.content.surveygroup import SurveyGroup
     from euphorie.content.survey import Survey
     surveygroup = SurveyGroup()
     surveygroup.title = u"Generic sector"
     surveygroup.evaluation_algorithm = u"french"
     surveygroup["standard"] = Survey()
     survey = surveygroup["standard"]  # Acquisition wrap
     survey.title = u"Standard"
     survey.introduction = None
     survey.classification_code = None
     survey.evaluation_optional = False
     survey.language = "en-GB"
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSurvey(root, survey)
     self.assertTrue(node in root)
     self.assertEqual(etree.tostring(root, pretty_print=True),
             '<root xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
             '  <survey>\n'
             '    <title>Generic sector</title>\n'
             '    <language>en-GB</language>\n'
             '    <evaluation-algorithm>french</evaluation-algorithm>\n'
             '    <evaluation-optional>false</evaluation-optional>\n'
             '  </survey>\n'
             '</root>\n')
Exemple #3
0
 def testSurvey_Minimal(self):
     from euphorie.content.surveygroup import SurveyGroup
     from euphorie.content.survey import Survey
     surveygroup = SurveyGroup()
     surveygroup.title = u"Generic sector"
     surveygroup.evaluation_algorithm = u"french"
     surveygroup["standard"] = Survey()
     survey = surveygroup["standard"]  # Acquisition wrap
     survey.title = u"Standard"
     survey.introduction = None
     survey.classification_code = None
     survey.evaluation_optional = False
     survey.language = "en-GB"
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportSurvey(root, survey)
     self.assertTrue(node in root)
     self.assertEqual(
         etree.tostring(root, pretty_print=True),
         '<root xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
         '  <survey>\n'
         '    <title>Generic sector</title>\n'
         '    <language>en-GB</language>\n'
         '    <evaluation-algorithm>french</evaluation-algorithm>\n'
         '    <evaluation-optional>false</evaluation-optional>\n'
         '  </survey>\n'
         '</root>\n')