Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 pydantic2 migration: fixed unit-tests for payments #6553

Merged
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic.errors import PydanticErrorMixin
from common_library.errors_classes import OsparcErrorMixin


class _BaseRpcApiError(PydanticErrorMixin, ValueError):
class _BaseRpcApiError(OsparcErrorMixin, ValueError):
@classmethod
def get_full_class_name(cls) -> str:
# Can be used as unique code identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ def random_payment_transaction(
"initiated_at": utcnow(),
"state": PaymentTransactionState.PENDING,
"completed_at": None,
"invoice_url": None,
"stripe_invoice_id": None,
"invoice_pdf_url": None,
"state_message": None,
}
# state is not added on purpose
assert set(data.keys()).issubset({c.name for c in payments_transactions.columns})
Expand Down
3 changes: 2 additions & 1 deletion packages/settings-library/src/settings_library/utils_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import rich
import typer
from common_library.serialization import model_dump_with_secrets
from models_library.utils.json_serialization import json_dumps
from pydantic import ValidationError
from pydantic_settings import BaseSettings

Expand Down Expand Up @@ -70,7 +71,7 @@ def print_as_json(
settings_obj, *, compact=False, show_secrets, **pydantic_export_options
):
typer.echo(
json.dumps(
json_dumps(
model_dump_with_secrets(
settings_obj, show_secrets=show_secrets, **pydantic_export_options
),
Expand Down
Loading
Loading