Beispiel #1
0
 def testProfileQuestion_LocationQuestions(self):
     profile = ProfileQuestion()
     profile.title = "Office buildings"
     profile.question = "Do you have an office building?"
     profile.label_multiple_present = "Do you have more than one building?"
     profile.label_single_occurance = "Enter the name of your building."
     profile.label_multiple_occurances = (
         "Enter the names of each of your buildings."  # noqa
     )
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportProfileQuestion(root, profile)
     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'
         "  <profile-question>\n"
         "    <title>Office buildings</title>\n"
         "    <question>Do you have an office building?</question>\n"
         "    <label-multiple-present>Do you have more than one building"
         "?</label-multiple-present>\n"
         "    <label-single-occurance>Enter the name of your building."
         "</label-single-occurance>\n"
         "    <label-multiple-occurances>Enter the names of each of your"
         " buildings.</label-multiple-occurances>\n"
         "    <use-location-question>true</use-location-question>\n"
         "  </profile-question>\n"
         "</root>\n",
     )
Beispiel #2
0
 def testProfileQuestion_LocationQuestions(self):
     from euphorie.content.profilequestion import ProfileQuestion
     profile = ProfileQuestion()
     profile.title = u"Office buildings"
     profile.question = u"Do you have an office building?"
     profile.label_multiple_present = u"Do you have more than one building?"
     profile.label_single_occurance = u"Enter the name of your building."
     profile.label_multiple_occurances = u"Enter the names of each of your buildings."
     root = self.root()
     view = ExportSurvey(None, None)
     node = view.exportProfileQuestion(root, profile)
     self.assertTrue(node in root)
     self.assertEqual(
         etree.tostring(root, pretty_print=True),
         '<root xmlns="http://xml.simplon.biz/euphorie/survey/1.0">\n'
         '  <profile-question>\n'
         '    <title>Office buildings</title>\n'
         '    <question>Do you have an office building?</question>\n'
         '    <label-multiple-present>Do you have more than one building'
         '?</label-multiple-present>\n'
         '    <label-single-occurance>Enter the name of your building.'
         '</label-single-occurance>\n'
         '    <label-multiple-occurances>Enter the names of each of your'
         ' buildings.</label-multiple-occurances>\n'
         '    <use-location-question>true</use-location-question>\n'
         '  </profile-question>\n'
         '</root>\n')