def csv_to_xform(request): csv_data = request.POST.get('txtImport') survey = utils.create_survey_from_csv_text(csv_data) response = HttpResponse(survey.to_xml(), content_type='application/force-download') response['Content-Disposition'] = 'attachment; filename=%s.xml' % (survey.id_string) return response
def csv_to_xform(request): csv_data = request.POST.get('txtImport') survey = utils.create_survey_from_csv_text(csv_data) response = HttpResponse(survey.to_xml(), mimetype='application/force-download') response['Content-Disposition'] = 'attachment; filename=%s.xml' % (survey.id_string) return response
def test_parses_survey_passed_in_as_csv_and_returns_xml_representation(self): xml = utils.create_survey_from_csv_text(text).to_xml() etree.fromstring(xml)
def test_unicode_surveys_work(self): survey = utils.create_survey_from_csv_text(utf_survey) xml = survey.to_xml() self.assertTrue(u"🍔" in xml)