예제 #1
0
 def test_sector_data(self):
     self.assertDictEqual(
         get_institutional_deliveries_sector_data('icds-cas',
                                                  config={
                                                      'month': (2017, 5, 1),
                                                      'state_id': 'st1',
                                                      'district_id': 'd1',
                                                      'block_id': 'b1',
                                                      'aggregation_level': 4
                                                  },
                                                  location_id='b1',
                                                  loc_level='supervisor'),
         {
             "info":
             "Percentage of pregnant women who delivered in a public or private medical "
             "facility in the last month. <br/><br/>Delivery in medical instituitions"
             " is associated with a decrease in maternal mortality rate",
             "tooltips_data": {
                 "s2": {
                     "all": 0,
                     "children": 0
                 },
                 "s1": {
                     "all": 2,
                     "children": 1
                 }
             },
             "chart_data": [{
                 "color": "#006fdf",
                 "classed": "dashed",
                 "strokeWidth": 2,
                 "values": [["s1", 0.5], ["s2", 0.0]],
                 "key": ""
             }]
         })
 def test_sector_data(self):
     self.assertDictEqual(
         get_institutional_deliveries_sector_data(
             'icds-cas',
             config={
                 'month': (2017, 5, 1),
                 'state_id': 'st1',
                 'district_id': 'd1',
                 'block_id': 'b1',
                 'aggregation_level': 4
             },
             location_id='b1',
             loc_level='supervisor'
         ),
         {
             "info": "Of the total number of women enrolled for Anganwadi services who gave birth in the "
                     "last month, the percentage who delivered in a public or private medical facility. "
                     "<br/><br/>"
                     "Delivery in medical instituitions is associated with a decrease in maternal "
                     "mortality rate",
             "tooltips_data": {
                 "s2": {
                     "all": 0,
                     "children": 0
                 },
                 "s1": {
                     "all": 2,
                     "children": 1
                 }
             },
             "chart_data": [
                 {
                     "color": MapColors.BLUE,
                     "classed": "dashed",
                     "strokeWidth": 2,
                     "values": [
                         [
                             "s1",
                             0.5
                         ],
                         [
                             "s2",
                             0.0
                         ]
                     ],
                     "key": ""
                 }
             ]
         }
     )
 def test_sector_data(self):
     self.assertDictEqual(
         get_institutional_deliveries_sector_data(
             'icds-cas',
             config={
                 'month': (2017, 5, 1),
                 'state_id': 'st1',
                 'district_id': 'd1',
                 'block_id': 'b1',
                 'aggregation_level': 4
             },
             location_id='b1',
             loc_level='supervisor'
         ),
         {
             "info": "Of the total number of women enrolled for Anganwadi services who gave birth in the "
                     "current month, the percentage who delivered in a public or private medical facility. "
                     "<br/><br/>"
                     "Delivery in medical instituitions is associated with a decrease in maternal "
                     "mortality rate",
             "tooltips_data": {
                 "s2": {
                     "all": 0,
                     "children": 0
                 },
                 "s1": {
                     "all": 1,
                     "children": 1
                 }
             },
             "chart_data": [
                 {
                     "color": MapColors.BLUE,
                     "classed": "dashed",
                     "strokeWidth": 2,
                     "values": [
                         [
                             "s1",
                             1.0
                         ],
                         [
                             "s2",
                             0.0
                         ]
                     ],
                     "key": ""
                 }
             ]
         }
     )