def test_data_daily_if_aggregation_script_fail_lactating_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "lactating_enrolled_women",
         "all": 166,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 166,
         "label": "Percent lactating women enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": (
             "Of the total number of lactating women, the percentage of lactating women enrolled for "
             "Anganwadi Services"
         )
     }
     self.assertDictEqual(expected, data['records'][2][0])
 def test_data_daily_if_aggregation_script_fail_adhaar(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "adhaar",
         "all": 1608,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 346,
         "label": "Percent Aadhaar-seeded Beneficiaries",
         "frequency": "day",
         "help_text": (
             "Of the total number of ICDS beneficiaries, the percentage whose Adhaar identification has "
             "been captured. "
         )
     }
     self.assertDictEqual(expected, data['records'][0][1])
 def test_data_monthly_lactating_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         'redirect':
         'lactating_enrolled_women',
         "all":
         166,
         "format":
         "percent_and_div",
         "color":
         "red",
         "percent":
         0.0,
         "value":
         166,
         "label":
         "Percent lactating women enrolled for Anganwadi Services",
         "frequency":
         "month",
         "help_text":
         "Percentage of lactating women "
         "registered who are enrolled for Anganwadi Services"
     }
     self.assertDictEqual(expected, data['records'][2][0])
 def test_data_daily_if_aggregation_script_fail_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "adolescent_girls",
         "all": 34,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 34,
         "label": "Percent adolescent girls (11-14 years) enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": (
             "Of the total number of adolescent girls (aged 11-14 years),"
             " the percentage of girls enrolled for Anganwadi Services"
         )
     }
     self.assertDictEqual(expected, data['records'][2][1])
示例#5
0
def get_program_summary_data(step, domain, config, now, include_test,
                             pre_release_features):
    data = {}
    retry = 0
    while True:
        config_copy = deepcopy(config)
        if step == 'maternal_child':
            data = get_maternal_child_data(domain, config_copy, include_test,
                                           pre_release_features)
        elif step == 'icds_cas_reach':
            data = get_cas_reach_data(
                domain,
                now,
                config_copy,
                include_test,
            )
        elif step == 'demographics':
            data = get_demographics_data(domain,
                                         now,
                                         config_copy,
                                         include_test,
                                         beta=pre_release_features)
        elif step == 'awc_infrastructure':
            data = get_awc_infrastructure_data(domain, config_copy,
                                               include_test)

        if not _all_zeros(data) or retry == 2:
            break
        else:
            sleep(5)
            retry += 1
    return data
示例#6
0
 def test_data_daily_if_aggregation_script_fail_adhaar(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/adhaar",
         "all": 1610,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 346,
         "label": "Percent Aadhaar-seeded Beneficiaries",
         "frequency": "day",
         "help_text": (
             "Of the total number of ICDS beneficiaries, the percentage whose Adhaar identification has "
             "been captured. "
         )
     }
     self.assertDictEqual(expected, data['records'][0][1])
 def test_data_monthly_enrolled_children(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect":
         "enrolled_children",
         "all":
         1287,
         "format":
         "percent_and_div",
         "color":
         "red",
         "percent":
         0.0,
         "value":
         1287,
         "label":
         "Percent children (0-6 years) enrolled for Anganwadi Services",
         "frequency":
         "month",
         "help_text":
         "Percentage of children registered"
         " between 0-6 years old who are enrolled for Anganwadi Services"
     }
     self.assertDictEqual(expected, data['records'][1][0])
 def test_data_daily_if_aggregation_script_fail_adhaar(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/adhaar",
         "all": 1609,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0,
         "value": 346,
         "label": AADHAR_SEEDED_BENEFICIARIES,
         "frequency": "day",
         "help_text": (
             "Of the total number of ICDS beneficiaries, the percentage whose Aadhaar identification has "
             "been captured. "
         )
     }
     self.assertDictEqual(expected, data['records'][0][1])
 def test_data_monthly_adhaar(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect":
         "adhaar",
         "all":
         500,
         "format":
         "percent_and_div",
         "color":
         "green",
         "percent":
         4.800000000000011,
         "value":
         131,
         "label":
         "Percent Aadhaar-seeded Beneficiaries",
         "frequency":
         "month",
         "help_text":
         "Percentage of ICDS beneficiaries"
         " whose Aadhaar identification has been captured"
     }
     self.assertDictEqual(expected, data['records'][0][1])
 def test_data_daily_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 29), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect":
         "enrolled_women",
         "all":
         155,
         "format":
         "percent_and_div",
         "color":
         "green",
         "percent":
         "Data in the previous reporting period was 0",
         "value":
         155,
         "label":
         "Percent pregnant women enrolled for Anganwadi Services",
         "frequency":
         "day",
         "help_text":
         ("Percentage of pregnant women registered who are enrolled for Anganwadi Services"
          )
     }
     self.assertDictEqual(expected, data['records'][1][1])
 def test_data_monthly_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect":
         "adolescent_girls",
         "all":
         34,
         "format":
         "percent_and_div",
         "color":
         "red",
         "percent":
         0.0,
         "value":
         34,
         "label":
         "Percent adolescent girls (11-14 years) enrolled for Anganwadi Services",
         "frequency":
         "month",
         "help_text":
         "Percentage of adolescent girls registered"
         " between 11-14 years old who are enrolled for Anganwadi Services"
     }
     self.assertDictEqual(expected, data['records'][2][1])
 def test_data_daily_enrolled_children(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 29),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "enrolled_children",
         "all": 1287,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 1287,
         "label": "Percent children (0-6 years) enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": (
             "Of the total number of children between 0-6 years, "
             "the percentage of children who are enrolled for Anganwadi Services"
         )
     }
     self.assertDictEqual(expected, data['records'][1][0])
示例#13
0
 def test_data_monthly_adhaar(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect":
         "demographics/adhaar",
         "all":
         1610,
         "format":
         "percent_and_div",
         "color":
         "green",
         "percent":
         10.049606069448492,
         "value":
         346,
         "label":
         "Percent Aadhaar-seeded Beneficiaries",
         "frequency":
         "month",
         "help_text":
         "Of the total number of ICDS beneficiaries, the percentage whose Adhaar identification "
         "has been captured. "
     }
     self.assertDictEqual(expected, data['records'][0][1])
示例#14
0
def get_program_summary_data(step, domain, config, now, include_test, pre_release_features):
    data = {}
    if step == 'maternal_child':
        data = get_maternal_child_data(domain, config, include_test, pre_release_features)
    elif step == 'icds_cas_reach':
        data = get_cas_reach_data(domain, now, config, include_test)
    elif step == 'demographics':
        data = get_demographics_data(domain, now, config, include_test, beta=pre_release_features)
    elif step == 'awc_infrastructure':
        data = get_awc_infrastructure_data(domain, config, include_test)
    return data
示例#15
0
 def test_data_daily_if_aggregation_script_fail_format(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 30), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     self.assertEqual(1, len(data))
     self.assertEqual(3, len(data['records']))
     self.assertEqual(2, len(data['records'][0]))
     self.assertEqual(2, len(data['records'][1]))
     self.assertEqual(2, len(data['records'][2]))
示例#16
0
 def test_data_monthly_format(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     self.assertEquals(1, len(data))
     self.assertEquals(3, len(data['records']))
     self.assertEquals(2, len(data['records'][0]))
     self.assertEquals(2, len(data['records'][1]))
     self.assertEquals(2, len(data['records'][2]))
示例#17
0
 def test_data_daily_if_aggregation_script_fail_format(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     self.assertEquals(1, len(data))
     self.assertEquals(3, len(data['records']))
     self.assertEquals(2, len(data['records'][0]))
     self.assertEquals(2, len(data['records'][1]))
     self.assertEquals(2, len(data['records'][2]))
示例#18
0
 def test_data_daily_if_aggregation_script_fail_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 30), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/adolescent_girls",
         "all": 34,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0,
         "value": 34,
         "label": ADOLESCENT_GIRLS_ENROLLED_FOR_ANGANWADI_SERVICES,
         "frequency": "day",
         "help_text": percent_adolescent_girls_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][1])
示例#19
0
 def test_data_daily_if_aggregation_script_fail_enrolled_children(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 30), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/enrolled_children",
         "all": 1287,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0,
         "value": 1287,
         "label": CHILDREN_ENROLLED_FOR_ANGANWADI_SERVICES,
         "frequency": "day",
         "help_text": percent_children_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][1][0])
示例#20
0
 def test_data_daily_if_aggregation_script_fail_registered_household(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 30), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/registered_household",
         "all": None,
         "format": "number",
         "color": "red",
         "percent": 0,
         "value": 2799,
         "label": "Registered Households",
         "frequency": "day",
         "help_text": "Total number of households registered"
     }
     self.assertDictEqual(expected, data['records'][0][0])
示例#21
0
 def test_data_daily_lactating_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 29), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/lactating_enrolled_women",
         "all": 167,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0,
         "value": 167,
         "label": LACTATING_WOMEN_ENROLLED_FOR_ANGANWADI_SERVICES,
         "frequency": "day",
         "help_text": percent_lactating_women_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][0])
示例#22
0
 def test_data_daily_lactating_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 29), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/lactating_enrolled_women",
         "all": 167,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0,
         "value": 167,
         "label": "Percent lactating women enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": percent_lactating_women_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][0])
示例#23
0
 def test_data_daily_registered_household(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 29), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/registered_household",
         "all": None,
         "format": "number",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 6964,
         "label": "Registered Households",
         "frequency": "day",
         "help_text": "Total number of households registered"
     }
     self.assertDictEqual(expected, data['records'][0][0])
示例#24
0
 def test_data_monthly_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/enrolled_women",
         "all": 155,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0.0,
         "value": 155,
         "label": PREGNANT_WOMEN_ENROLLED_FOR_ANGANWADI_SERVICES,
         "frequency": "month",
         "help_text": percent_pregnant_women_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][1][1])
示例#25
0
 def test_data_monthly_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/enrolled_women",
         "all": 155,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0.0,
         "value": 155,
         "label": "Percent pregnant women enrolled for Anganwadi Services",
         "frequency": "month",
         "help_text": percent_pregnant_women_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][1][1])
示例#26
0
 def test_data_monthly_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas', (2017, 6, 1), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/adolescent_girls",
         "all": 24,
         "format": "percent_and_div",
         "color": "red",
         "percent": 37.49999999999998,
         "value": 2,
         "label": OUT_OF_SCHOOL_ADOLESCENT_GIRLS_11_14_YEARS,
         "frequency": "month",
         "help_text": percent_adolescent_girls_enrolled_help_text_v2()
     }
     self.assertDictEqual(expected, data['records'][2][1])
示例#27
0
 def test_data_daily_if_aggregation_script_fail_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 30), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/adolescent_girls",
         "all": 34,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0,
         "value": 34,
         "label":
         "Percent adolescent girls (11-14 years) enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": percent_adolescent_girls_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][1])
示例#28
0
 def test_data_daily_if_aggregation_script_fail_enrolled_children(self):
     data = get_demographics_data(
         'icds-cas', (2017, 5, 30), {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         })
     expected = {
         "redirect": "demographics/enrolled_children",
         "all": 1288,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 1288,
         "label":
         "Percent children (0-6 years) enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": percent_children_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][1][0])
示例#29
0
 def test_data_monthly_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 6, 1),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/enrolled_women",
         "all": 155,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0.0,
         "value": 155,
         "label": "Percent pregnant women enrolled for Anganwadi Services",
         "frequency": "month",
         "help_text": percent_pregnant_women_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][1][1])
示例#30
0
 def test_data_daily_if_aggregation_script_fail_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/adolescent_girls",
         "all": 34,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 34,
         "label": "Percent adolescent girls (11-14 years) enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": percent_adolescent_girls_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][1])
示例#31
0
 def test_data_daily_if_aggregation_script_fail_registered_household(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 30),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/registered_household",
         "all": None,
         "format": "number",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 6964,
         "label": "Registered Households",
         "frequency": "day",
         "help_text": "Total number of households registered"
     }
     self.assertDictEqual(expected, data['records'][0][0])
示例#32
0
 def test_data_monthly_registered_household(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 6, 1),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/registered_household",
         "all": None,
         "format": "number",
         "color": "red",
         "percent": 0.0,
         "value": 6964,
         "label": "Registered Households",
         "frequency": "month",
         "help_text": "Total number of households registered"
     }
     self.assertDictEqual(expected, data['records'][0][0])
示例#33
0
 def test_data_daily_lactating_enrolled_women(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 5, 29),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/lactating_enrolled_women",
         "all": 167,
         "format": "percent_and_div",
         "color": "green",
         "percent": "Data in the previous reporting period was 0",
         "value": 167,
         "label": "Percent lactating women enrolled for Anganwadi Services",
         "frequency": "day",
         "help_text": percent_lactating_women_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][0])
示例#34
0
 def test_data_monthly_adolescent_girls(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 6, 1),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/adolescent_girls",
         "all": 34,
         "format": "percent_and_div",
         "color": "red",
         "percent": 0.0,
         "value": 34,
         "label": "Percent adolescent girls (11-14 years) enrolled for Anganwadi Services",
         "frequency": "month",
         "help_text": percent_adolescent_girls_enrolled_help_text()
     }
     self.assertDictEqual(expected, data['records'][2][1])
示例#35
0
 def test_data_monthly_adhaar(self):
     data = get_demographics_data(
         'icds-cas',
         (2017, 6, 1),
         {
             'month': (2017, 5, 1),
             'prev_month': (2017, 4, 1),
             'aggregation_level': 1
         }
     )
     expected = {
         "redirect": "demographics/adhaar",
         "all": 1610,
         "format": "percent_and_div",
         "color": "green",
         "percent": 10.049606069448492,
         "value": 346,
         "label": "Percent Aadhaar-seeded Beneficiaries",
         "frequency": "month",
         "help_text": "Of the total number of ICDS beneficiaries, the percentage whose Adhaar identification "
                      "has been captured. "
     }
     self.assertDictEqual(expected, data['records'][0][1])
示例#36
0
 def test_data_monthly(self):
     self.assertDictEqual(
         get_demographics_data(
             'icds-cas', (2017, 6, 1), {
                 'month': (2017, 5, 1),
                 'prev_month': (2017, 4, 1),
                 'aggregation_level': 1
             }),
         {
             "records":
             [[{
                 "redirect": "registered_household",
                 "all": None,
                 "format": "number",
                 "color": "red",
                 "percent": 0.0,
                 "value": 6964,
                 "label": "Registered Households",
                 "frequency": "month",
                 "help_text": "Total number of households registered"
             }, {
                 "redirect":
                 "adhaar",
                 "all":
                 500,
                 "format":
                 "percent_and_div",
                 "color":
                 "green",
                 "percent":
                 4.800000000000011,
                 "value":
                 131,
                 "label":
                 "Percent Aadhaar-seeded Beneficiaries",
                 "frequency":
                 "month",
                 "help_text":
                 "Percentage of ICDS beneficiaries"
                 " whose Aadhaar identification has been captured"
             }],
              [{
                  "redirect":
                  "enrolled_children",
                  "all":
                  1287,
                  "format":
                  "percent_and_div",
                  "color":
                  "red",
                  "percent":
                  0.0,
                  "value":
                  1287,
                  "label":
                  "Percent children (0-6 years) enrolled for ICDS services",
                  "frequency":
                  "month",
                  "help_text":
                  "Percentage of children registered"
                  " between 0-6 years old who are enrolled for ICDS services"
              }, {
                  "redirect":
                  "enrolled_women",
                  "all":
                  155,
                  "format":
                  "percent_and_div",
                  "color":
                  "red",
                  "percent":
                  0.0,
                  "value":
                  155,
                  "label":
                  "Percent pregnant women enrolled for ICDS services",
                  "frequency":
                  "month",
                  "help_text":
                  "Percentage of pregnant women "
                  "registered who are enrolled for ICDS services"
              }],
              [{
                  'redirect':
                  'lactating_enrolled_women',
                  "all":
                  166,
                  "format":
                  "percent_and_div",
                  "color":
                  "red",
                  "percent":
                  0.0,
                  "value":
                  166,
                  "label":
                  "Percent lactating women enrolled for ICDS services",
                  "frequency":
                  "month",
                  "help_text":
                  "Percentage of lactating women "
                  "registered who are enrolled for ICDS services"
              }, {
                  "redirect":
                  "adolescent_girls",
                  "all":
                  47,
                  "format":
                  "percent_and_div",
                  "color":
                  "red",
                  "percent":
                  0.0,
                  "value":
                  47,
                  "label":
                  "Percent adolescent girls (11-18 years) enrolled for ICDS services",
                  "frequency":
                  "month",
                  "help_text":
                  "Percentage of adolescent girls registered"
                  " between 11-18 years old who are enrolled for ICDS services"
              }]]
         })
示例#37
0
 def test_data(self):
     self.assertDictEqual(
         get_demographics_data(
             'icds-cas', (2017, 5, 28), {
                 'month': (2017, 5, 1),
                 'prev_month': (2017, 4, 1),
                 'aggregation_level': 1
             }),
         {
             "records":
             [[{
                 "redirect": "registered_household",
                 "color": "red",
                 "all": None,
                 "frequency": "month",
                 "format": "number",
                 "help_text": "Total number of households registered",
                 "percent": 0.0,
                 "value": 6964,
                 "label": "Registered Households"
             }, {
                 "redirect": "adhaar",
                 "color": "green",
                 "all": 500,
                 "frequency": "month",
                 "format": "percent_and_div",
                 "help_text": "Percentage of ICDS beneficiaries whose"
                 " Adhaar identification has been captured",
                 "percent": 4.800000000000011,
                 "value": 131,
                 "label": "Percent Adhaar-seeded Beneficiaries"
             }],
              [{
                  "redirect": "enrolled_children",
                  "color": "green",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text":
                  "Total number of children registered between the age of 0 - 6 years",
                  "percent": 1.9809825673534072,
                  "value": 1287,
                  "label": "Children (0-6 years)"
              }, {
                  "color": "green",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text":
                  "Total number of children registered between "
                  "the age of 0 - 6 years and enrolled for ICDS services",
                  "percent": 1.9809825673534072,
                  "value": 1287,
                  "label": "Children (0-6 years) enrolled for ICDS services"
              }],
              [{
                  "redirect": "enrolled_women",
                  "color": "green",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text": "Total number of pregnant women registered",
                  "percent": 49.03846153846153,
                  "value": 155,
                  "label": "Pregnant Women"
              }, {
                  "color": "green",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text": "Total number of pregnant women registered"
                  " and enrolled for ICDS services",
                  "percent": 49.03846153846153,
                  "value": 155,
                  "label": "Pregnant Women enrolled for ICDS services"
              }],
              [{
                  "redirect": "lactating_enrolled_women",
                  "color": "green",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text": "Total number of lactating women registered",
                  "percent": 4.40251572327044,
                  "value": 166,
                  "label": "Lactating Women"
              }, {
                  "color": "green",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text": "Total number of lactating women registered"
                  " and enrolled for ICDS services",
                  "percent": 4.40251572327044,
                  "value": 166,
                  "label": "Lactating Women enrolled for ICDS services"
              }],
              [{
                  "redirect": "adolescent_girls",
                  "color": "red",
                  "all": None,
                  "frequency": "month",
                  "format": "number",
                  "help_text":
                  "Total number of adolescent girls (11 - 18 years) who are registered",
                  "percent": -17.543859649122805,
                  "value": 47,
                  "label": "Adolescent Girls (11-18 years)"
              }, {
                  "color":
                  "red",
                  "all":
                  None,
                  "frequency":
                  "month",
                  "format":
                  "number",
                  "help_text":
                  "Total number of adolescent girls (11 - 18 years)"
                  " who are registered and enrolled for ICDS services",
                  "percent":
                  -17.543859649122805,
                  "value":
                  47,
                  "label":
                  "Adolescent Girls (11-18 years) enrolled for ICDS services"
              }]]
         })