def test_map_name_is_different_data(self): self.maxDiff = None self.assertDictEqual( get_registered_household_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'state_id': 'st1', 'district_id': 'd1', 'aggregation_level': 3 }, loc_level='block', ), { "rightLegend": { "info": "Total number of households registered: 3,633", "average": 1816.5, "average_format": "number" }, "fills": { "Household": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'block_map': { 'household': 3633, 'original_name': ['b1', 'b2'], 'fillKey': 'Household' } }, "slug": "registered_household", "label": "" })
def test_map_data(self): self.assertDictEqual( get_registered_household_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state' ), { "rightLegend": { "info": "Total number of households registered: 2,799", "average": 399.85714285714283, "average_format": "number" }, "fills": { "Household": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'st4': {'household': 0, 'original_name': ['st4'], 'fillKey': 'Household'}, 'st5': {'household': 0, 'original_name': ['st5'], 'fillKey': 'Household'}, 'st6': {'household': 0, 'original_name': ['st6'], 'fillKey': 'Household'}, 'st7': {'household': 1, 'original_name': ['st7'], 'fillKey': 'Household'}, 'st1': {'household': 1322, 'original_name': ['st1'], 'fillKey': 'Household'}, 'st2': {'household': 1476, 'original_name': ['st2'], 'fillKey': 'Household'}, 'st3': {'household': 0, 'original_name': ['st3'], 'fillKey': 'Household'} }, "slug": "registered_household", "label": "" } )
def test_map_name_is_different_data(self): self.maxDiff = None self.assertDictEqual( get_registered_household_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'state_id': 'st1', 'district_id': 'd1', 'aggregation_level': 3 }, loc_level='block', ), { "rightLegend": { "info": "Total number of households registered: 3,633", "average": 1816.5, "average_format": "number" }, "fills": { "Household": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'block_map': { 'household': 3633, 'original_name': ['b1', 'b2'], 'fillKey': 'Household' } }, "slug": "registered_household", "label": "" } )
def test_map_data(self): self.assertDictEqual( get_registered_household_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state' ), { "rightLegend": { "info": "Total number of households registered: 6,964", "average": 994.8571428571429, "average_format": "number" }, "fills": { "Household": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'st4': {'household': 0, 'original_name': ['st4'], 'fillKey': 'Household'}, 'st5': {'household': 0, 'original_name': ['st5'], 'fillKey': 'Household'}, 'st6': {'household': 0, 'original_name': ['st6'], 'fillKey': 'Household'}, 'st7': {'household': 0, 'original_name': ['st7'], 'fillKey': 'Household'}, 'st1': {'household': 3633, 'original_name': ['st1'], 'fillKey': 'Household'}, 'st2': {'household': 3331, 'original_name': ['st2'], 'fillKey': 'Household'}, 'st3': {'household': 0, 'original_name': ['st3'], 'fillKey': 'Household'} }, "slug": "registered_household", "label": "" } )
def test_map_data(self): self.assertDictEqual( get_registered_household_data_map('icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state'), { "rightLegend": { "info": "Total number of households registered: 6,964", "average": 3482.0, "average_format": "number" }, "fills": { "Household": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { "st1": { "household": 3633, 'original_name': ["st1"], "fillKey": "Household" }, "st2": { "household": 3331, 'original_name': ["st2"], "fillKey": "Household" } }, "slug": "registered_household", "label": "" })
def test_map_data(self): self.assertDictEqual( get_registered_household_data_map('icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state')[0], { "rightLegend": { "info": "Total number of households registered", "average": 3482.0, "average_format": "number" }, "fills": { "Household": "#006fdf", "defaultFill": "#9D9D9D" }, "data": { "st1": { "household": 3633, "fillKey": "Household" }, "st2": { "household": 3331, "fillKey": "Household" } }, "slug": "registered_household", "label": "" })