Compare commits

...

2 Commits

3 changed files with 5 additions and 1 deletions

View File

@ -140,7 +140,7 @@ class DigestAuth:
return view(*args, **kwargs) return view(*args, **kwargs)
except UnauthorizedException as e: except UnauthorizedException as e:
if len(e.args) > 0: if len(e.args) > 0:
sys.stderr.write(e.args[0] + "\n") current_app.logger.warning(e.args[0])
response: Response = Response() response: Response = Response()
response.status = 401 response.status = 401
response.headers["WWW-Authenticate"] \ response.headers["WWW-Authenticate"] \

View File

@ -18,6 +18,7 @@
"""The test case for the HTTP digest authentication. """The test case for the HTTP digest authentication.
""" """
import logging
from secrets import token_urlsafe from secrets import token_urlsafe
from typing import Any, Optional, Dict from typing import Any, Optional, Dict
@ -55,6 +56,7 @@ class AuthenticationTestCase(TestCase):
:return: The Flask application. :return: The Flask application.
""" """
logging.getLogger("test_auth").addHandler(logging.NullHandler())
app: Flask = Flask(__name__) app: Flask = Flask(__name__)
app.config.from_mapping({ app.config.from_mapping({
"TESTING": True, "TESTING": True,

View File

@ -18,6 +18,7 @@
"""The test case for the Flask-Login integration. """The test case for the Flask-Login integration.
""" """
import logging
from secrets import token_urlsafe from secrets import token_urlsafe
from typing import Optional, Dict from typing import Optional, Dict
@ -75,6 +76,7 @@ class FlaskLoginTestCase(TestCase):
:return: The Flask application. :return: The Flask application.
""" """
logging.getLogger("test_flask_login").addHandler(logging.NullHandler())
app: Flask = Flask(__name__) app: Flask = Flask(__name__)
app.config.from_mapping({ app.config.from_mapping({
"TESTING": True, "TESTING": True,