コード例 #1
0
 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()
コード例 #2
0
 def setUpClass(cls):
     cls.manager = get_db_manager('http://localhost:5984/',
                                  uniq('mangrove-test'))
     initializer._create_views(cls.manager)
     cls.entity_type = ["HealthFacility", "Clinic"]
     safe_define_type(cls.manager, ["HealthFacility", "Clinic"])
     cls._create_form_model()
コード例 #3
0
    def setUpClass(cls):
        cls.manager = get_db_manager('http://localhost:5984/', 'mangrove-test')
        _delete_db_and_remove_db_manager(cls.manager)
        cls.manager = get_db_manager('http://localhost:5984/', 'mangrove-test')
        initializer._create_views(cls.manager)

        cls.org_id = 'SLX364903'
        cls._prepare_sms_data_senders()
        cls.test_ds_id = get_by_short_code_include_voided(
            cls.manager, "test", REPORTER_ENTITY_TYPE).id
        deleted_ds = get_by_short_code_include_voided(cls.manager, "del1",
                                                      REPORTER_ENTITY_TYPE)
        deleted_ds.void()
        cls.deleted_ds_id = deleted_ds.id
コード例 #4
0
    def setUpClass(cls):
        EntityDocument.registered_functions = []
        database_name = uniq('mangrove-test')
        cls.manager = get_db_manager('http://localhost:5984/', database_name)
        _delete_db_and_remove_db_manager(cls.manager)
        cls.manager = get_db_manager('http://localhost:5984/', database_name)
        initializer._create_views(cls.manager)

        cls.org_id = 'SLX364903'
        cls._prepare_sms_data_senders()
        cls.test_ds_id = get_by_short_code_include_voided(
            cls.manager, "test", REPORTER_ENTITY_TYPE).id
        deleted_ds = get_by_short_code_include_voided(cls.manager, "del1",
                                                      REPORTER_ENTITY_TYPE)
        deleted_ds.void()
        cls.deleted_ds_id = deleted_ds.id
コード例 #5
0
    def setUpClass(cls):
        EntityFormModelDocument.registered_functions = []
        EntityDocument.registered_functions = []
        cls.manager = get_db_manager('http://localhost:5984/',
                                     uniq('mangrove-test'))
        initializer._create_views(cls.manager)
        cls.username = '******'
        cls.datasender_user, _ = User.objects.get_or_create(
            username=cls.username, email=cls.username, password='******')
        cls.datasender_user.save()

        cls.mobile_number = '112233'
        cls.org_id = "test_org"
        cls.reporter_id = "rptr1"
        cls.datasender_user_profile = NGOUserProfile(
            user=cls.datasender_user,
            title='Mr.',
            org_id=cls.org_id,
            mobile_phone=cls.mobile_number,
            reporter_id=cls.reporter_id)
        cls.datasender_user_profile.save()
コード例 #6
0
ファイル: database_utils.py プロジェクト: mariot/mangrove
def create_dbmanager_for_ut(cls):
        cls.db_name = uniq('mangrove-test-unit')
        cls.manager = get_db_manager('http://localhost:5984/', cls.db_name)
        _delete_db_and_remove_db_manager(cls.manager)
        cls.manager = get_db_manager('http://localhost:5984/', cls.db_name)
        initializer._create_views(cls.manager)
コード例 #7
0
 def setUpClass(cls):
     cls.manager = get_db_manager('http://localhost:5984/', 'mangrove-test')
     initializer._create_views(cls.manager)
     cls._create_default_dd_type()
     cls._create_form_model()
コード例 #8
0
 def setUp(self):
     self.db_name = uniq('mangrove-test')
     self.manager = get_db_manager('http://localhost:5984/', self.db_name)
     initializer._create_views(self.manager)