def test_map_data(self): self.assertDictEqual( get_lactating_enrolled_women_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state' )[0], { "rightLegend": { "info": "Lactating Mothers enrolled for ICDS services.", "average": 83.0, "average_format": "number" }, "fills": { "Women": "#006fdf", "defaultFill": "#9D9D9D" }, "data": { "st1": { "valid": 87, "fillKey": "Women" }, "st2": { "valid": 79, "fillKey": "Women" } }, "slug": "lactating_enrolled_women", "label": "" } )
def test_map_data(self): self.assertDictEqual( get_lactating_enrolled_women_data_map('icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state'), { "rightLegend": { "info": "Of the total number of lactating women, the percentage of lactating women enrolled " "for Anganwadi Services", "average": 83.0, "average_format": "number", 'extended_info': [{ 'indicator': 'Number of lactating women who are enrolled for Anganwadi Services:', 'value': "166" }, { 'indicator': 'Total number of lactating women who are registered:', 'value': "166" }, { 'indicator': ('Percentage of registered lactating women who are enrolled for Anganwadi Services:' ), 'value': '100.00%' }] }, "fills": { "Women": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { "st1": { "valid": 87, "all": 87, 'original_name': ["st1"], "fillKey": "Women" }, "st2": { "valid": 79, "all": 79, 'original_name': ["st2"], "fillKey": "Women" } }, "slug": "lactating_enrolled_women", "label": "" })
def test_map_name_is_different_data(self): self.assertDictEqual( get_lactating_enrolled_women_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'state_id': 'st1', 'district_id': 'd1', 'aggregation_level': 3 }, loc_level='block', ), { "rightLegend": { "info": "Of the total number of lactating women, the percentage of lactating women enrolled " "for Anganwadi Services", "average": 43.5, "average_format": "number", 'extended_info': [{ 'indicator': 'Number of lactating women who are enrolled for Anganwadi Services:', 'value': "87" }, { 'indicator': 'Total number of lactating women who are registered:', 'value': "87" }, { 'indicator': ('Percentage of registered lactating women who are enrolled for Anganwadi Services:' ), 'value': '100.00%' }] }, "fills": { "Women": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'block_map': { 'valid': 87, 'all': 87, 'original_name': ['b1', 'b2'], 'fillKey': 'Women' } }, "slug": "lactating_enrolled_women", "label": "" })
def test_map_name_is_different_data(self): self.assertDictEqual( get_lactating_enrolled_women_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'state_id': 'st1', 'district_id': 'd1', 'aggregation_level': 3 }, loc_level='block', ), { "rightLegend": { "info": percent_lactating_women_enrolled_help_text(), "average": '100.00', 'extended_info': [ { 'indicator': 'Number of lactating women who are enrolled for Anganwadi Services:', 'value': "87" }, {'indicator': 'Total number of lactating women who are registered:', 'value': "87"}, { 'indicator': ( 'Percentage of registered lactating women who are enrolled for Anganwadi Services:' ), 'value': '100.00%' } ] }, "fills": { "Women": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'block_map': { 'valid': 87, 'all': 87, 'original_name': ['b1', 'b2'], 'fillKey': 'Women' } }, "slug": "lactating_enrolled_women", "label": "" } )
def test_map_data(self): self.assertDictEqual( get_lactating_enrolled_women_data_map( 'icds-cas', config={ 'month': (2017, 5, 1), 'aggregation_level': 1 }, loc_level='state' ), { "rightLegend": { "info": percent_lactating_women_enrolled_help_text(), "average": '100.00', 'extended_info': [ { 'indicator': 'Number of lactating women who are enrolled for Anganwadi Services:', 'value': "167" }, {'indicator': 'Total number of lactating women who are registered:', 'value': "167"}, { 'indicator': ( 'Percentage of registered lactating women who are enrolled for Anganwadi Services:' ), 'value': '100.00%' } ] }, "fills": { "Women": MapColors.BLUE, "defaultFill": MapColors.GREY }, "data": { 'st4': {'all': 0, 'valid': 0, 'original_name': ['st4'], 'fillKey': 'Women'}, 'st5': {'all': 0, 'valid': 0, 'original_name': ['st5'], 'fillKey': 'Women'}, 'st6': {'all': 0, 'valid': 0, 'original_name': ['st6'], 'fillKey': 'Women'}, 'st7': {'all': 1, 'valid': 1, 'original_name': ['st7'], 'fillKey': 'Women'}, 'st1': {'all': 87, 'valid': 87, 'original_name': ['st1'], 'fillKey': 'Women'}, 'st2': {'all': 79, 'valid': 79, 'original_name': ['st2'], 'fillKey': 'Women'}, 'st3': {'all': 0, 'valid': 0, 'original_name': ['st3'], 'fillKey': 'Women'} }, "slug": "lactating_enrolled_women", "label": "" } )