def test_sector_data(self):
     self.assertDictEqual(
         get_infants_weight_scale_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 AWCs that reported having a weighing scale for infants",
             "tooltips_data": {
                 "s2": {
                     "in_month": 3,
                     "all": 1
                 },
                 "s1": {
                     "in_month": 4,
                     "all": 1
                 }
             },
             "chart_data": [{
                 "color": MapColors.BLUE,
                 "classed": "dashed",
                 "strokeWidth": 2,
                 "values": [["s1", 4.0], ["s2", 3.0]],
                 "key": ""
             }]
         })
Ejemplo n.º 2
0
 def test_sector_data(self):
     data = get_infants_weight_scale_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'
     )
     self.assertListEqual(
         data['chart_data'],
         [
             {
                 "color": MapColors.BLUE,
                 "classed": "dashed",
                 "strokeWidth": 2,
                 "values": [
                     [
                         "s1",
                         0.8
                     ],
                     [
                         "s2",
                         1.0
                     ]
                 ],
                 "key": ""
             }
         ]
     )
Ejemplo n.º 3
0
 def test_sector_data_tooltips_data(self):
     data = get_infants_weight_scale_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'
     )
     self.assertDictEqual(
         data['tooltips_data'],
         {
             "s2": {
                 "in_month": 3,
                 "all": 3
             },
             "s1": {
                 "in_month": 4,
                 "all": 5
             }
         }
     )
 def test_sector_data_tooltips_data(self):
     data = get_infants_weight_scale_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'
     )
     self.assertDictEqual(
         data['tooltips_data'],
         {
             "s2": {
                 "in_month": 3,
                 "all": 3
             },
             "s1": {
                 "in_month": 4,
                 "all": 5
             }
         }
     )
 def test_sector_data(self):
     data = get_infants_weight_scale_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'
     )
     self.assertListEqual(
         data['chart_data'],
         [
             {
                 "color": MapColors.BLUE,
                 "classed": "dashed",
                 "strokeWidth": 2,
                 "values": [
                     [
                         "s1",
                         0.8
                     ],
                     [
                         "s2",
                         1.0
                     ]
                 ],
                 "key": ""
             }
         ]
     )
 def test_sector_data_info(self):
     data = get_infants_weight_scale_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')
     self.assertEqual(data['info'],
                      awcs_reported_weighing_scale_infants_help_text())
Ejemplo n.º 7
0
 def test_sector_data_info(self):
     data = get_infants_weight_scale_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')
     self.assertEquals(
         data['info'],
         "Percentage of AWCs that reported having a weighing scale for infants"
     )
Ejemplo n.º 8
0
 def test_sector_data_keys(self):
     data = get_infants_weight_scale_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')
     self.assertEquals(len(data), 3)
     self.assertIn('info', data)
     self.assertIn('tooltips_data', data)
     self.assertIn('chart_data', data)
 def test_sector_data_info(self):
     data = get_infants_weight_scale_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'
     )
     self.assertEquals(
         data['info'],
         awcs_reported_weighing_scale_infants_help_text()
     )
 def test_sector_data_keys(self):
     data = get_infants_weight_scale_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'
     )
     self.assertEquals(len(data), 3)
     self.assertIn('info', data)
     self.assertIn('tooltips_data', data)
     self.assertIn('chart_data', data)