'Add multiple states to the db for testing.'

def _add_test_states(self):

    now = datetime.now()
    five_days_ago = (now - timedelta(days=5))
    attributes = {'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 < 3):
                timestamp = five_days_ago
                state = 'purgeme'
            else:
                timestamp = now
                state = 'dontpurgeme'
            session.add(States(entity_id='test.recorder2', domain='sensor', state=state, attributes=json.dumps(attributes), last_changed=timestamp, last_updated=timestamp, created=timestamp, event_id=(event_id + 1000)))
