Files
julius_baer_onboarding/tests/test_validation.py

28 lines
920 B
Python
Raw Permalink Normal View History

2025-04-12 14:20:40 +02:00
from datetime import date
from pydantic import ValidationError
import pytest
from tests.dummy import dummy_account, dummy_passport
2025-04-12 14:20:40 +02:00
from validation.from_passport import FromPassport
def test_check_expiry_date_after_issue_date() -> None:
dummy = dummy_passport()
with pytest.raises(ValidationError):
dummy.expiry_date = date(1900, 1, 1)
def test_invalid_email() -> None:
dummy = dummy_account()
with pytest.raises(ValidationError):
dummy.email = "this is not a valid email account"
def test_invalid_phone_number() -> None:
dummy = dummy_account()
with pytest.raises(ValidationError):
dummy.phone_number = "This should be invalid"
2025-04-12 15:21:22 +02:00
dummy.phone_number = "+41 32 333 33 33"
def test_check_account_name_ebanking_name() -> None:
dummy = dummy_account()
with pytest.raises(ValidationError):
dummy.ebanking_name = "This is not the same as the account name"