'Test that the vulnerability_aggregate records are being generated correctly.
Because the vulnerability_aggregate records depend on earlier results it is
important that all these test are in the same test so that the
interdependence of the indicators can be checked.
Summary of test data:
1) Indicator 1 for gis4_1 in 2006 = 3
2) Indicator 2 for gis4_1 in 2006 = 4
3) Indicator 1 for gis4_1 in 2009 = 5
4) Indicator 1 for gis4_2 in 2010 = 2
5) Indicator 1 for gis4_2 in 2008 = 3
6) Indicator 1 for gis4_2 in 2009 = 1'

def testVulnerability_aggregate(self):

    from datetime import date
    db = current.db
    s3db = current.s3db
    vtable = s3db.vulnerability_data
    approve_record = self.approve_record
    indicators = self.indicators
    location_ids = self.location_ids
    update_super = s3db.update_super
    validateAggregateData = self.validateAggregateData
    step = 1
    indicator_id = indicators[0]
    location_id = location_ids['gis4_1']
    actual_date = date(2006, 5, 12)
    id = vtable.insert(parameter_id=indicator_id, location_id=location_id, value=3, date=actual_date)
    update_super(vtable, dict(id=id))
    approve_record(id)
    expected = Storage(rule1=Storage(type={date(2006, 1, 1): 1, date(2007, 1, 1): 3}, data={date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}}), rule2=Storage(data={location_ids['gis3_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}}}), rule3=Storage(data={location_ids['gis4_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}}, location_ids['gis3_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}}}))
    validateAggregateData(step, actual_date, indicator_id, location_id, expected)
    step = 2
    indicator_id = indicators[1]
    location_id = location_ids['gis4_1']
    actual_date = date(2006, 5, 12)
    id = vtable.insert(parameter_id=indicator_id, location_id=location_id, value=4, date=actual_date)
    update_super(vtable, dict(id=id))
    approve_record(id)
    expected = Storage(rule1=Storage(type={date(2006, 1, 1): 1, date(2007, 1, 1): 3}, data={date(2006, 1, 1): {'max': 4, 'min': 4, 'mean': 4, 'median': 4, 'reported_count': 1, 'ward_count': 1}, date(2007, 1, 1): {'max': 4, 'min': 4, 'mean': 4, 'median': 4, 'reported_count': 1, 'ward_count': 1}}), rule2=Storage(data={location_ids['gis3_1']: {date(2006, 1, 1): {'max': 4, 'min': 4, 'mean': 4, 'median': 4, 'reported_count': 1, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 4, 'min': 4, 'mean': 4, 'median': 4, 'reported_count': 1, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 4, 'min': 4, 'mean': 4, 'median': 4, 'reported_count': 1, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 4, 'min': 4, 'mean': 4, 'median': 4, 'reported_count': 1, 'ward_count': 12}}}), rule3=Storage(data={location_ids['gis4_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 1}}, location_ids['gis3_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}}}))
    validateAggregateData(step, actual_date, indicator_id, location_id, expected)
    step = 3
    indicator_id = indicators[0]
    location_id = location_ids['gis4_1']
    actual_date = date(2009, 7, 23)
    id = vtable.insert(parameter_id=indicator_id, location_id=location_id, value=5, date=actual_date)
    update_super(vtable, dict(id=id))
    approve_record(id)
    expected = Storage()
    expected['rule1'] = Storage(type={date(2006, 1, 1): 1, date(2007, 1, 1): 3, date(2009, 1, 1): 1, date(2010, 1, 1): 3}, data={date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 1}})
    expected['rule2'] = Storage(data={location_ids['gis3_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 12}}})
    expected['rule3'] = Storage(data={location_ids['gis4_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 1}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 1}}, location_ids['gis3_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 12}}})
    validateAggregateData(step, actual_date, indicator_id, location_id, expected)
    step = 4
    indicator_id = indicators[0]
    location_id = location_ids['gis4_2']
    actual_date = date(2010, 3, 13)
    id = vtable.insert(parameter_id=indicator_id, location_id=location_id, value=2, date=actual_date)
    update_super(vtable, dict(id=id))
    approve_record(id)
    expected = Storage()
    expected['rule1'] = Storage(type={date(2010, 1, 1): 1, date(2011, 1, 1): 3}, data={date(2010, 1, 1): {'max': 2, 'min': 2, 'mean': 2, 'median': 2, 'reported_count': 1, 'ward_count': 1}})
    expected['rule2'] = Storage(data={location_ids['gis3_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 3}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 8}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 5, 'mean': 5, 'median': 5, 'reported_count': 1, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 12}}})
    expected['rule3'] = Storage(data={location_ids['gis4_2']: {date(2010, 1, 1): {'max': 2, 'min': 2, 'mean': 2, 'median': 2, 'reported_count': 1, 'ward_count': 1}}, location_ids['gis3_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 3}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 8}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 4, 'mean': 4.5, 'median': 4.5, 'reported_count': 1, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}}})
    validateAggregateData(step, actual_date, indicator_id, location_id, expected)
    step = 5
    indicator_id = indicators[0]
    location_id = location_ids['gis4_2']
    actual_date = date(2008, 2, 5)
    id = vtable.insert(parameter_id=indicator_id, location_id=location_id, value=3, date=actual_date)
    update_super(vtable, dict(id=id))
    approve_record(id)
    expected = Storage()
    expected['rule1'] = Storage(type={date(2008, 1, 1): 1, date(2009, 1, 1): 3, date(2010, 1, 1): 1, date(2011, 1, 1): 3}, data={date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}, date(2010, 1, 1): {'max': 2, 'min': 2, 'mean': 2, 'median': 2, 'reported_count': 1, 'ward_count': 1}})
    expected['rule2'] = Storage(data={location_ids['gis3_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 3}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 3}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 8}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 8}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 12}}})
    expected['rule3'] = Storage(data={location_ids['gis4_2']: {date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}, date(2010, 1, 1): {'max': 2, 'min': 2, 'mean': 2, 'median': 2, 'reported_count': 1, 'ward_count': 1}}, location_ids['gis3_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 3}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 3}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 8}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 8}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 3, 'mean': 4, 'median': 4, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}}})
    validateAggregateData(step, actual_date, indicator_id, location_id, expected)
    step = 6
    indicator_id = indicators[0]
    location_id = location_ids['gis4_2']
    actual_date = date(2009, 12, 5)
    id = vtable.insert(parameter_id=indicator_id, location_id=location_id, value=1, date=actual_date)
    update_super(vtable, dict(id=id))
    approve_record(id)
    expected = Storage()
    expected['rule1'] = Storage(type={date(2008, 1, 1): 1, date(2009, 1, 1): 1, date(2010, 1, 1): 1, date(2011, 1, 1): 3}, data={date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}, date(2009, 1, 1): {'max': 1, 'min': 1, 'mean': 1, 'median': 1, 'reported_count': 1, 'ward_count': 1}, date(2010, 1, 1): {'max': 2, 'min': 2, 'mean': 2, 'median': 2, 'reported_count': 1, 'ward_count': 1}})
    expected['rule2'] = Storage(data={location_ids['gis3_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 3}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 3}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 8}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 8}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': 3, 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': 3.5, 'median': 3.5, 'reported_count': 2, 'ward_count': 12}}})
    expected['rule3'] = Storage(data={location_ids['gis4_2']: {date(2008, 1, 1): {'max': 3, 'min': 3, 'mean': 3, 'median': 3, 'reported_count': 1, 'ward_count': 1}, date(2009, 1, 1): {'max': 1, 'min': 1, 'mean': 1, 'median': 1, 'reported_count': 1, 'ward_count': 1}, date(2010, 1, 1): {'max': 2, 'min': 2, 'mean': 2, 'median': 2, 'reported_count': 1, 'ward_count': 1}}, location_ids['gis3_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 3}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 3}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': (10.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 3}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 3}}, location_ids['gis2_1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 8}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 8}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': (10.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 8}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 8}}, location_ids['gis1']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': (10.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}}, location_ids['gis0']: {date(2006, 1, 1): {'max': 4, 'min': 3, 'mean': 3.5, 'median': 3.5, 'reported_count': 1, 'ward_count': 12}, date(2008, 1, 1): {'max': 4, 'min': 3, 'mean': (10.0 / 3), 'median': 3, 'reported_count': 2, 'ward_count': 12}, date(2009, 1, 1): {'max': 5, 'min': 1, 'mean': (10.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}, date(2010, 1, 1): {'max': 5, 'min': 2, 'mean': (11.0 / 3), 'median': 4, 'reported_count': 2, 'ward_count': 12}}})
    validateAggregateData(step, actual_date, indicator_id, location_id, expected)
