def test_should_return_data_for_given_location_only(self): create_attribute() locations = [self.kampala_district] self.p3_boys_enrolled_poll.start() self.fake_incoming('10', self.emis_reporter1) self.fake_incoming('10', self.emis_reporter2) self.fake_incoming('10', self.emis_reporter3) #gulu response result_absent, result_enrolled,school_percent = get_responses_over_depth(self.p3_boys_absent_poll.name, self.p3_boys_enrolled_poll.name, locations, self.date_week) location_result = result_enrolled[0] self.assertFalse(self.gulu_district.name in location_result.values())
def test_should_return_sum_over_districts(self): create_attribute() locations = [self.kampala_district, self.gulu_district] self.p3_boys_enrolled_poll.start() self.fake_incoming('10', self.emis_reporter1) self.fake_incoming('10', self.emis_reporter2) self.p3_boys_enrolled_poll.end() result_absent, result_enrolled,school_percent = get_responses_over_depth(self.p3_boys_absent_poll.name, self.p3_boys_enrolled_poll.name, locations, self.date_week) kampala_result = result_enrolled[0] self.assertTrue(self.kampala_district.name in kampala_result.values()) self.assertIn(20.0, kampala_result.values()) self.assertEqual(0,school_percent)