示例#1
0
 def setUp(self):
     self.domain = 'post-api-test'
     bootstrap_domain(self.domain)
     self.api = MockOpenLMISEndpoint("uri://mock/lmis/endpoint",
                                     username='******',
                                     password='******')
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
示例#2
0
 def setUp(self):
     self.domain = 'post-api-test'
     bootstrap_domain(self.domain)
     self.api = MockOpenLMISEndpoint("uri://mock/lmis/endpoint",
                                     username='******',
                                     password='******')
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
     LocationType.objects.get_or_create(domain=self.domain, name='chw')
示例#3
0
 def setUp(self):
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
     bootstrap_domain(TEST_DOMAIN)
     delete_all_cases()
     for loc in Location.by_domain(TEST_DOMAIN):
         loc.delete()
     LocationType.objects.get_or_create(
         domain=TEST_DOMAIN,
         name="Lvl3 Hospital",
     )
 def setUp(self):
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
     bootstrap_domain(TEST_DOMAIN)
     delete_all_cases()
     for loc in Location.by_domain(TEST_DOMAIN):
         loc.delete()
     LocationType.objects.get_or_create(
         domain=TEST_DOMAIN,
         name="Lvl3 Hospital",
     )
示例#5
0
def prepare_domain(domain_name):
    from corehq.apps.commtrack.tests import bootstrap_domain
    domain = bootstrap_domain(domain_name)
    previous = None
    for name, administrative in [("MOHSW", True), ("MSDZONE", True),
                                 ("REGION", True), ("DISTRICT", True),
                                 ("FACILITY", False)]:
        previous, _ = LocationType.objects.get_or_create(
            domain=domain_name,
            name=name,
            parent_type=previous,
            administrative=administrative,
        )

    generator.instantiate_accounting_for_tests()
    account = BillingAccount.get_or_create_account_by_domain(
        domain.name,
        created_by="automated-test",
    )[0]
    plan = DefaultProductPlan.get_default_plan_by_domain(
        domain, edition=SoftwarePlanEdition.ADVANCED)
    commtrack = domain.commtrack_settings
    commtrack.actions.append(
        CommtrackActionConfig(action='receipts',
                              keyword='delivered',
                              caption='Delivered'))
    commtrack.save()
    subscription = Subscription.new_domain_subscription(
        account, domain.name, plan)
    subscription.is_active = True
    subscription.save()
    ils_config = ILSGatewayConfig(enabled=True, domain=domain.name)
    ils_config.save()
    return domain
示例#6
0
def prepare_domain(domain_name):
    from corehq.apps.commtrack.tests import bootstrap_domain
    domain = bootstrap_domain(domain_name)

    def _make_loc_type(name, administrative=False, parent_type=None):
        return LocationType.objects.get_or_create(
            domain=domain_name,
            name=name,
            administrative=administrative,
            parent_type=parent_type,
        )[0]

    country = _make_loc_type(name="country", administrative=True)
    _make_loc_type(name="Central Medical Store", parent_type=country)
    _make_loc_type(name="Teaching Hospital", parent_type=country)

    region = _make_loc_type(name="region",
                            administrative=True,
                            parent_type=country)
    _make_loc_type(name="Regional Medical Store", parent_type=region)
    _make_loc_type(name="Regional Hospital", parent_type=region)

    district = _make_loc_type(name="district",
                              administrative=True,
                              parent_type=region)
    _make_loc_type(name="Clinic", parent_type=district)
    _make_loc_type(name="District Hospital", parent_type=district)
    _make_loc_type(name="Health Centre", parent_type=district)
    _make_loc_type(name="CHPS Facility", parent_type=district)
    _make_loc_type(name="Hospital", parent_type=district)
    _make_loc_type(name="Psychiatric Hospital", parent_type=district)
    _make_loc_type(name="Polyclinic", parent_type=district)
    _make_loc_type(name="facility", parent_type=district)

    generator.instantiate_accounting_for_tests()
    account = BillingAccount.get_or_create_account_by_domain(
        domain.name,
        created_by="automated-test",
    )[0]
    plan = DefaultProductPlan.get_default_plan_by_domain(
        domain, edition=SoftwarePlanEdition.ADVANCED)
    subscription = Subscription.new_domain_subscription(
        account, domain.name, plan)
    subscription.is_active = True
    subscription.save()
    ews_config = EWSGhanaConfig(enabled=True, domain=domain.name)
    ews_config.save()
    return domain
示例#7
0
def prepare_domain(domain_name):
    from corehq.apps.commtrack.tests import bootstrap_domain
    domain = bootstrap_domain(domain_name)

    def _make_loc_type(name, administrative=False, parent_type=None):
        return LocationType.objects.get_or_create(
            domain=domain_name,
            name=name,
            administrative=administrative,
            parent_type=parent_type,
        )[0]

    country = _make_loc_type(name="country", administrative=True)
    _make_loc_type(name="Central Medical Store", parent_type=country)
    _make_loc_type(name="Teaching Hospital", parent_type=country)

    region = _make_loc_type(name="region", administrative=True, parent_type=country)
    _make_loc_type(name="Regional Medical Store", parent_type=region)
    _make_loc_type(name="Regional Hospital", parent_type=region)

    district = _make_loc_type(name="district", administrative=True, parent_type=region)
    _make_loc_type(name="Clinic", parent_type=district)
    _make_loc_type(name="District Hospital", parent_type=district)
    _make_loc_type(name="Health Centre", parent_type=district)
    _make_loc_type(name="CHPS Facility", parent_type=district)
    _make_loc_type(name="Hospital", parent_type=district)
    _make_loc_type(name="Psychiatric Hospital", parent_type=district)
    _make_loc_type(name="Polyclinic", parent_type=district)
    _make_loc_type(name="facility", parent_type=district)

    generator.instantiate_accounting_for_tests()
    account = BillingAccount.get_or_create_account_by_domain(
        domain.name,
        created_by="automated-test",
    )[0]
    plan = DefaultProductPlan.get_default_plan_by_domain(
        domain, edition=SoftwarePlanEdition.ADVANCED
    )
    subscription = Subscription.new_domain_subscription(
        account,
        domain.name,
        plan
    )
    subscription.is_active = True
    subscription.save()
    ews_config = EWSGhanaConfig(enabled=True, domain=domain.name)
    ews_config.save()
    return domain
示例#8
0
def prepare_domain(domain_name):
    from corehq.apps.commtrack.tests import bootstrap_domain
    domain = bootstrap_domain(domain_name)
    previous = None
    for name, administrative in [
        ("MOHSW", True),
        ("MSDZONE", True),
        ("REGION", True),
        ("DISTRICT", True),
        ("FACILITY", False)
    ]:
        previous, _ = LocationType.objects.get_or_create(
            domain=domain_name,
            name=name,
            parent_type=previous,
            administrative=administrative,
        )

    generator.instantiate_accounting_for_tests()
    account = BillingAccount.get_or_create_account_by_domain(
        domain.name,
        created_by="automated-test",
    )[0]
    plan = DefaultProductPlan.get_default_plan_by_domain(
        domain, edition=SoftwarePlanEdition.ADVANCED
    )
    commtrack = domain.commtrack_settings
    commtrack.actions.append(
        CommtrackActionConfig(action='receipts',
                              keyword='delivered',
                              caption='Delivered')
    )
    commtrack.save()
    subscription = Subscription.new_domain_subscription(
        account,
        domain.name,
        plan
    )
    subscription.is_active = True
    subscription.save()
    ils_config = ILSGatewayConfig(enabled=True, domain=domain.name)
    ils_config.save()
    return domain
 def setUp(self):
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
     bootstrap_domain(TEST_DOMAIN)
     delete_all_cases()
     for loc in Location.by_domain(TEST_DOMAIN):
         loc.delete()
 def setUp(self):
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
     bootstrap_domain(TEST_DOMAIN)
     for product in Product.by_domain(TEST_DOMAIN):
         product.delete()
示例#11
0
 def setUp(self):
     self.domain = "post-api-test"
     bootstrap_domain(self.domain)
     self.api = MockOpenLMISEndpoint("uri://mock/lmis/endpoint", username="******", password="******")
     self.datapath = os.path.join(os.path.dirname(__file__), "data")
     LocationType.objects.get_or_create(domain=self.domain, name="chw")
示例#12
0
 def setUp(self):
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')
     bootstrap_domain(TEST_DOMAIN)
     delete_all_cases()
     for loc in Location.by_domain(TEST_DOMAIN):
         loc.delete()
示例#13
0
 def setUp(self):
     self.domain = 'post-api-test'
     bootstrap_domain(self.domain)
     self.api = MockOpenLMISEndpoint("uri://mock/lmis/endpoint", username='******', password='******')
     self.datapath = os.path.join(os.path.dirname(__file__), 'data')