fix: add compatibility layer to move to flask>=3 #64
Annotations
6 errors
Run tests:
tests/resources/test_resources.py#L101
test_create_banner
assert 400 == 201
+ where 400 = <WrapperTestResponse streamed [400 BAD REQUEST]>.status_code
|
Run tests:
tests/resources/test_resources.py#L117
test_disable_expired_after_create_action
assert 400 == 201
+ where 400 = <WrapperTestResponse streamed [400 BAD REQUEST]>.status_code
|
Run tests:
tests/services/test_services.py#L67
test_banner_creation
marshmallow.exceptions.ValidationError: {'start_datetime': ['Missing data for required field.'], 'end_datetime': ['Not a valid datetime.']}
|
Run tests:
invenio_banners/resources/errors.py#L1
isort-check
"""Errors."""
-from flask_resources import HTTPJSONException, create_error_handler
-
-from ..services.errors import BannerNotExistsError
import marshmallow as ma
from flask_resources import HTTPJSONException, create_error_handler
from invenio_records_resources.errors import validation_error_to_list_errors
+
+from ..services.errors import BannerNotExistsError
class HTTPJSONValidationException(HTTPJSONException):
|
Run tests:
invenio_banners/resources/errors.py#L1
Black format check
--- /home/runner/work/invenio-banners/invenio-banners/invenio_banners/resources/errors.py 2024-09-23 21:13:44.371698+00:00
+++ /home/runner/work/invenio-banners/invenio-banners/invenio_banners/resources/errors.py 2024-09-23 21:15:47.920787+00:00
@@ -23,11 +23,11 @@
def __init__(self, exception):
"""Constructor."""
super().__init__(code=400, errors=validation_error_to_list_errors(exception))
-class ErrorHandlersMixin():
+class ErrorHandlersMixin:
"""Mixin to define error handlers."""
error_handlers = {
BannerNotExistsError: create_error_handler(
lambda e: HTTPJSONException(
|
Run tests
Process completed with exit code 1.
|
Loading