def test_data_fetching_total_record_count_for_home_visit_api(self):
     """
     test to check the total count of records that are returned from the home visit api
     """
     limit = GOVERNANCE_API_RECORDS_PAGINATION
     query_filters = {'aggregation_level': 5}
     order = ['awc_id']
     data, count = get_home_visit_data(limit, 2017, 5, order, query_filters)
     expected_count = 55
     self.assertEqual(count, expected_count)
Exemplo n.º 2
0
 def test_data_fetching_total_record_count_with_state_id_for_home_visit_api(
         self):
     """
     test to check the total count of records that are returned from the home visit api
     """
     limit = GOVERNANCE_API_PAGE_SIZE
     query_filters = {'aggregation_level': 5, 'state_id': 'st1'}
     order = ['awc_id']
     data, count = get_home_visit_data(limit, 2017, 5, order, query_filters)
     expected_count = 26
     self.assertEqual(count, expected_count)
Exemplo n.º 3
0
 def test_data_fetching_total_record_count_for_no_records_for_home_visit_api(
         self):
     """
     test to check the no records are returned from the home visit api
     """
     limit = GOVERNANCE_API_PAGE_SIZE
     query_filters = {'aggregation_level': 5}
     order = ['awc_id']
     data, count = get_home_visit_data(limit, 2017, 6, order, query_filters)
     expected_count = 0
     self.assertEqual(count, expected_count)
     self.assertEqual(data, [])
 def test_data_fetching_without_start_for_home_visit_api(self):
     """
     test to check the first record that is returned from the home visit api without start parameter
     """
     limit = GOVERNANCE_API_RECORDS_PAGINATION
     query_filters = {'aggregation_level': 5}
     order = ['awc_id']
     data, count = get_home_visit_data(limit, 2017, 5, order, query_filters)
     expected_first_row = {
         'awc_id': 'a1',
         'awc_code': 'a1',
         'valid_visits': 0,
         'expected_visits': 4,
     }
     self.assertEqual(data[0], expected_first_row)
Exemplo n.º 5
0
    def test_data_fetching_with_start_for_home_visit_api(self):
        """
        test to check the first record that is returned from the home visit api with start parameter
        """
        limit = CAS_API_PAGE_SIZE
        query_filters = {'aggregation_level': 5, 'awc_id__gt': 'a1'}
        order = ['awc_id']

        data, count = get_home_visit_data(limit, 2017, 5, order, query_filters)
        expected_first_row = {
            'awc_id': 'a10',
            'awc_code': 'a10',
            'valid_visits': 0,
            'expected_visits': 2
        }
        self.assertEqual(data[0], expected_first_row)