def test_path_for_model(): traject = Traject() class IdModel(object): def __init__(self, id): self.id = id traject.register_inverse(IdModel, 'foo/{id}', lambda model: {'id': model.id}) assert traject.get_path(IdModel('a')) == 'foo/a'