'Convert a shorthand entity description into a full ID reference.
In test plan definitions, we allow a shorthand for referencing to an
entity of the form:
\'user\': 0
which is actually shorthand for:
\'user_id\': reference_data[\'users\'][0][\'id\']
This method converts the shorthand version into the full reference.'

def _convert_entity_shorthand(self, key, shorthand_data, reference_data):

    expanded_key = ('%s_id' % key)
    reference_index = ('%ss' % key)
    index_value = reference_data[reference_index][shorthand_data[key]]['id']
    return (expanded_key, index_value)
