'Test converting deleting state event to db state.'

def test_from_event_to_delete_state(self):

    event = ha.Event(EVENT_STATE_CHANGED, {'entity_id': 'sensor.temperature', 'old_state': ha.State('sensor.temperature', '18'), 'new_state': None})
    db_state = States.from_event(event)
    assert (db_state.entity_id == 'sensor.temperature')
    assert (db_state.domain == 'sensor')
    assert (db_state.state == '')
    assert (db_state.last_changed == event.time_fired)
    assert (db_state.last_updated == event.time_fired)
