예제 #1
0
 def set_up_app(self):
     self.factory = AppFactory(build_version='2.30.0')
     training_module = self.factory.app.add_module(Module.new_training_module('training module', None))
     self.releases_form = self.factory.app.new_form(training_module.id, "Untitled Form", None)
     self.releases_form.is_release_notes_form=True
     self.releases_form.xmlns = "http://openrosa.org/formdesigner/{}".format(uuid.uuid4().hex)
     basic_module, self.basic_form = self.factory.new_basic_module("basic_module", "doctor", with_form=True)
     self.basic_form.xmlns = "http://openrosa.org/formdesigner/{}".format(uuid.uuid4().hex)
예제 #2
0
    def test_training_module_as_parent(self, *args):
        factory = AppFactory(build_version='2.43.0')
        app = factory.app

        training_module = Module.new_training_module('training', 'en')
        app.add_module(training_module)

        child_module, _ = factory.new_basic_module('child', 'case_type', parent_module=training_module)

        self.assertIn({
            'type': 'training module parent',
            'module': {'id': 1, 'unique_id': 'child_module', 'name': {'en': 'child module'}}
        }, app.validate_app())
예제 #3
0
 def test_training_module_put_in_root(self, *args):
     app = Application.new_app('domain', 'Untitled Application')
     training_module = app.add_module(
         Module.new_training_module('training module', None))
     training_module.put_in_root = True
     app.new_form(training_module.id, "Untitled Form", None)
     self.assertXmlPartialEqual(
         """
         <partial>
             <menu id="training-root">
                 <text>
                     <locale id="training.root.title"/>
                 </text>
                 <command id="m0-f0"/>
             </menu>
         </partial>
         """, app.create_suite(), "./menu")
예제 #4
0
def _new_training_module(request, domain, app, name, lang):
    name = name or 'Training'
    module = app.add_module(Module.new_training_module(name, lang))
    app.save()
    return back_to_main(request, domain, app_id=app.id, module_id=module.id)
예제 #5
0
def _new_training_module(request, domain, app, name, lang):
    name = name or 'Training'
    module = app.add_module(Module.new_training_module(name, lang))
    app.save()
    return back_to_main(request, domain, app_id=app.id, module_id=module.id)