'Test if logbook message is correctly created for device tracker.'

def test_entry_message_from_state_device_tracker(self):

    pointA = dt_util.utcnow()
    eventA = self.create_state_changed_event(pointA, 'device_tracker.john', STATE_NOT_HOME)
    to_state = ha.State.from_dict(eventA.data.get('new_state'))
    message = logbook._entry_message_from_state(to_state.domain, to_state)
    self.assertEqual('is    away', message)
    eventA = self.create_state_changed_event(pointA, 'device_tracker.john', 'work')
    to_state = ha.State.from_dict(eventA.data.get('new_state'))
    message = logbook._entry_message_from_state(to_state.domain, to_state)
    self.assertEqual('is    at    work', message)
