

def build_app_with_recently_fixed_form(self):
    '\n        Generates an app with a form that:\n        - had an "undefined" xmlns\n        - had forms submitted with the bad xmlns\n        - had xmlns changed to something real\n        - had forms submitted with real xmlns\n        '
    form_name = 'Untitled Form'
    app = Application.new_app(DOMAIN, 'Normal App', APP_V2)
    module = app.add_module(Module.new_module('New Module', lang='en'))
    form_source = self.get_xml('form_template').format(xmlns='undefined', name=form_name)
    form = module.new_form(form_name, 'en', form_source)
    app.save()
    bad_build = app.make_build()
    bad_build.save()
    bad_xform = self._submit_form(form.xmlns, form_name, app._id, bad_build._id)
    xmlns = generate_random_xmlns()
    form = app.get_form(form.unique_id)
    form.source = self.get_xml('form_template').format(xmlns=xmlns, name=form_name)
    form.xmlns = xmlns
    app.save()
    good_build = app.make_build()
    good_build.save()
    good_xform = self._submit_form(form.xmlns, form_name, app._id, good_build._id)
    return (form, good_build, bad_xform, good_xform, bad_xform)

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/cleanup/tests/test_fix_forms_with_missing_xmlns.py TestFixFormsWithMissingXmlns.build_app_with_recently_fixed_form/VarMisuse@213/397 `bad_build`->`bad_xform`