Exemplo n.º 1
0
 def setUp(self):
     self.this_directory = os.path.dirname(__file__)
     survey_out = Survey(name=u"age", sms_keyword=u"age", type=u"survey")
     question = InputQuestion(name=u"age")
     question.type = u"integer"
     question.label = u"How old are you?"
     survey_out.add_child(question)
     self.survey_out_dict = survey_out.to_json_dict()
     print_pyobj_to_json(self.survey_out_dict, utils.path_to_text_fixture("how_old_are_you.json"))
Exemplo n.º 2
0
 def setUp(self):
     self.this_directory = os.path.dirname(__file__)
     survey_out = Survey(name=u"age", type=u"survey")
     question = InputQuestion(name=u"age")
     question.type = u"integer"
     question.label = u"How old are you?"
     survey_out.add_child(question)
     self.survey_out_dict = survey_out.to_json_dict()
     print_pyobj_to_json(self.survey_out_dict,
                         utils.path_to_text_fixture("how_old_are_you.json"))
Exemplo n.º 3
0
    def test_output_node_for_select_one_question_type(self):

        self.this_directory = os.path.dirname(__file__)
        survey_out = Survey(name="geopgraphy", sms_keyword="geography", type="survey")
        question = InputQuestion(name="counties")
        question.type = "select one external"
        question.label = "county"
        survey_out.add_child(question)

        expected = '<input ref="/geopgraphy/counties">'

        xml = survey_out.to_xml()
        self.assertEqual(1, xml.count(expected))