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)
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
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
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 })
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} )