ticketfrei3/tests/test_api_admin.py

16 lines
436 B
Python
Raw Normal View History

2020-07-07 01:16:23 +00:00
# Copyright (C) 2020 by Thomas Lindner <tom@dl6tom.de>
#
# SPDX-License-Identifier: 0BSD
from fastapi import status
def test_hoods_unauthorized(client):
response = client.get('/api/admin/hoods/')
assert response.status_code == status.HTTP_401_UNAUTHORIZED
def test_hoods_success(client, auth_header):
response = client.get('/api/admin/hoods/', headers=auth_header)
assert response.status_code == status.HTTP_200_OK