Esempio n. 1
0
def edition_client(empty_app):
    """Client with token-based auth with ADMIN_EDITION permissions."""
    _c = TestClient(empty_app, EDITION_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Esempio n. 2
0
def anon_client(empty_app):
    """Anonymous client."""
    client = TestClient(empty_app, '', '')
    return client
Esempio n. 3
0
def product_client(empty_app):
    """Client with token-based auth with ADMIN_PRODUCT permissions."""
    _c = TestClient(empty_app, PRODUCT_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Esempio n. 4
0
def basic_client(empty_app):
    """Client with username/password auth, using the `app` application."""
    client = TestClient(empty_app, DEFAULT_USERNAME, DEFAULT_PASSWORD)
    return client
Esempio n. 5
0
def client(empty_app):
    """Client with token-based auth, using the `app` application."""
    _c = TestClient(empty_app, DEFAULT_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Esempio n. 6
0
def upload_build_client(empty_app):
    """Client with token-based auth with UPLOAD_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_UPLOADER_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Esempio n. 7
0
def deprecate_build_client(empty_app):
    """Client with token-based auth with DEPRECATE_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_DEPRECATOR_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Esempio n. 8
0
def edition_client(empty_app):
    """Client with token-based auth with ADMIN_EDITION permissions."""
    _c = TestClient(empty_app, EDITION_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Esempio n. 9
0
def product_client(empty_app):
    """Client with token-based auth with ADMIN_PRODUCT permissions."""
    _c = TestClient(empty_app, PRODUCT_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Esempio n. 10
0
def client(empty_app):
    """Client with token-based auth, using the `app` application."""
    _c = TestClient(empty_app, DEFAULT_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Esempio n. 11
0
def deprecate_build_client(empty_app):
    """Client with token-based auth with DEPRECATE_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_DEPRECATOR_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Esempio n. 12
0
def upload_build_client(empty_app):
    """Client with token-based auth with UPLOAD_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_UPLOADER_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client