예제 #1
0
 def test_get_supply_point_ids_in_domain_by_location(self):
     actual = get_supply_point_ids_in_domain_by_location(self.domain)
     expected = {
         location.location_id: location.linked_supply_point().case_id
         for location in self.locations
     }
     self.assertEqual(actual, expected)
예제 #2
0
 def test_get_supply_point_ids_in_domain_by_location(self):
     actual = get_supply_point_ids_in_domain_by_location(self.domain)
     expected = {
         location.location_id: location.linked_supply_point().case_id
         for location in self.locations
     }
     self.assertEqual(actual, expected)
예제 #3
0
 def include_consumption(self):
     if bool(self.include_consumption_flag and self.domain_obj.
             commtrack_settings.individual_consumption_defaults):
         # we'll be needing these, so init 'em:
         self.products = Product.by_domain(self.domain)
         self.product_codes = [p.code for p in self.products]
         self.supply_point_map = get_supply_point_ids_in_domain_by_location(
             self.domain)
         self.administrative_types = {
             lt.name
             for lt in self.domain_obj.location_types if lt.administrative
         }
         return True
     return False
예제 #4
0
파일: util.py 프로젝트: sheelio/commcare-hq
    def include_consumption(self):
        if bool(
            self.include_consumption_flag and
            self.domain_obj.commtrack_settings.individual_consumption_defaults
        ):
            # we'll be needing these, so init 'em:
            self.products = Product.by_domain(self.domain)
            self.product_codes = [p.code for p in self.products]
            self.supply_point_map = get_supply_point_ids_in_domain_by_location(
                self.domain)
            self.administrative_types = {
                lt.name for lt in self.domain_obj.location_types
                if lt.administrative

            }
            return True
        return False
예제 #5
0
 def test_get_supply_point_ids_in_domain_by_location(self):
     self.assertEqual(
         get_supply_point_ids_in_domain_by_location(self.domain), {
             location._id: supply_point._id
             for location, supply_point in self.location_supply_point_pairs
         })
예제 #6
0
 def test_get_supply_point_ids_in_domain_by_location(self):
     self.assertEqual(
         get_supply_point_ids_in_domain_by_location(self.domain),
         {location._id: supply_point._id
          for location, supply_point in self.location_supply_point_pairs}
     )