Exemplo n.º 1
0
def test_index_lists_authclients_sorted_by_name(pyramid_request, routes):
    clients = [AuthClient(authority='foo.org', name='foo'),
               AuthClient(authority='foo.org', name='bar')]
    for client in clients:
        pyramid_request.db.add(client)

    ctx = index(pyramid_request)

    expected_clients = [clients[1], clients[0]]
    assert ctx == {'clients': expected_clients}
def test_index_lists_authclients_sorted_by_name(pyramid_request, routes):
    clients = [
        AuthClient(authority="foo.org", name="foo"),
        AuthClient(authority="foo.org", name="bar"),
    ]
    for client in clients:
        pyramid_request.db.add(client)

    ctx = index(pyramid_request)

    expected_clients = [clients[1], clients[0]]
    assert ctx == {"clients": expected_clients}
Exemplo n.º 3
0
    def authclient(self, pyramid_request):
        client = AuthClient(name='testclient',
                            authority='annotator.org',
                            secret='not_a_secret',
                            trusted=False,
                            grant_type=GrantType.authorization_code,
                            response_type=ResponseType.code)

        pyramid_request.db.add(client)

        return client