

def build_app_with_bad_form(self):
    '\n        Generates an app with one normal form, and one form with "undefined" xmlns\n        Generates submissions against both forms.\n        '
    xmlns = generate_random_xmlns()
    good_form_name = 'Untitled Form'
    bad_form_name = 'Bad Form'
    app = Application.new_app(DOMAIN, 'Normal App', APP_V2)
    module = app.add_module(Module.new_module('New Module', lang='en'))
    good_form_source = self.get_xml('form_template').format(xmlns=xmlns, name=good_form_name)
    good_form = module.new_form(good_form_name, 'en', good_form_source)
    bad_form_source = self.get_xml('form_template').format(xmlns='undefined', name=bad_form_name)
    bad_form = module.new_form(bad_form_name, 'en', bad_form_source)
    app.save()
    build = app.make_build()
    build.save()
    good_xform = self._submit_form(xmlns, good_form_name, app._id, build._id)
    bad_xforms = []
    for i in range(2):
        bad_xform = self._submit_form('undefined', bad_form_name, app._id, build._id)
        bad_xforms.append(bad_xform)
    return (good_form, bad_form, good_xform, bad_xforms)

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/cleanup/tests/test_fix_forms_with_missing_xmlns.py TestFixFormsWithMissingXmlns.build_app_with_bad_form/original