def setUpClass(cls): FormModelDocument.registered_functions = [] cls.db_name = uniq('mangrove-test') cls.manager = get_db_manager('http://localhost:5984/', cls.db_name) initializer._create_views(cls.manager) create_views(cls.manager) question1 = UniqueIdField(unique_id_type='clinic', name="entity_question", code="ID", label="What is associated entity") question2 = TextField(name="question1_Name", code="Q1", label="What is your name", defaultValue="some default value", constraints=[TextLengthConstraint(5, 10)]) cls.project1 = Project(dbm=cls.manager, name=project1_name, goals="Testing", devices=['web'], form_code="abc", fields=[question1, question2]) cls.project1_id = cls.project1.save() cls.project2 = Project(dbm=cls.manager, name=project2_name, goals="Testing", devices=['web'], form_code="def", fields=[question1, question2]) cls.project2_id = cls.project2.save()
def handle(self, *args, **options): manager = load_manager_for_default_test_account() print ("Deleting %s.....") % (manager.database_name,) _delete_db_and_remove_db_manager(manager) manager = load_manager_for_default_test_account() print "Loading All View" mangrove.datastore.views.create_views(manager) create_views(manager) print "Loading data....." load_data() print "Done."
def setUp(self): self.dbm = get_db_manager(database='mangrove-test') create_views(self.dbm) self.project1 = Project(name="Test1", goals="Testing", project_type="Survey", entity_type="Clinic", devices=['web']) self.project1_id = self.project1.save(self.dbm) self.project2 = Project(name="Test2", goals="Testing", project_type="Survey", entity_type="Clinic", devices=['web']) self.project2_id = self.project2.save(self.dbm) self._create_form_model_for_project(self.project1)
def handle(self, *args, **options): manager = load_manager_for_default_test_account() print("Deleting %s.....") % (manager.database_name, ) _delete_db_and_remove_db_manager(manager) manager = load_manager_for_default_test_account() print "Loading All View" mangrove.datastore.views.create_views(manager) create_views(manager) print "Loading data....." load_data() print "Done."
def setUp(self): MangroveTestCase.setUp(self) create_views(self.manager) self.project1 = Project(name="Test1", goals="Testing", project_type="Survey", entity_type="Clinic", devices=['web']) self.project1_id = self.project1.save(self.manager) self.project2 = Project(name="Test2", goals="Testing", project_type="Survey", entity_type="Clinic", devices=['web']) self.project2_id = self.project2.save(self.manager) self._create_form_model_for_project(self.project1)