コード例 #1
0
ファイル: links_test.py プロジェクト: ziqizh/h
def test_json_link(factories, pyramid_config, pyramid_request):
    annotation = factories.Annotation(id='e22AJlHYQNCG70bXL7gr1w')
    pyramid_config.add_route('api.annotation', '/annos/{id}')

    link = links.json_link(pyramid_request, annotation)

    assert link == 'http://example.com/annos/e22AJlHYQNCG70bXL7gr1w'
コード例 #2
0
def test_json_link(factories, pyramid_config, pyramid_request):
    annotation = factories.Annotation(id="e22AJlHYQNCG70bXL7gr1w")
    pyramid_config.add_route("api.annotation", "/annos/{id}")

    link = links.json_link(pyramid_request, annotation)

    assert link == "http://example.com/annos/e22AJlHYQNCG70bXL7gr1w"