'Add a few events for testing.'

def _add_test_events(self):

    now = datetime.now()
    five_days_ago = (now - timedelta(days=5))
    event_data = {'test_attr': 5, 'test_attr_10': 'nice'}
    self.hass.block_till_done()
    self.hass.data[DATA_INSTANCE].block_till_done()
    with recorder.session_scope(hass=self.hass) as session:
        for event_id in range(5):
            if (event_id < 2):
                timestamp = five_days_ago
                event_type = 'EVENT_TEST_PURGE'
            else:
                timestamp = now
                event_type = 'EVENT_TEST'
            session.add(Events(event_type=event_type, event_data=json.dumps(event_data), origin='LOCAL', created=timestamp, time_fired=timestamp))
