Add FastAPI admin/public API service, database setup, Docker deployment files, docs, and tests.
14 lines
360 B
Python
14 lines
360 B
Python
import pytest
|
|
from pydantic import ValidationError
|
|
from app.schemas import LeadCreateIn, ProductCreateIn
|
|
|
|
|
|
def test_lead_phone_is_normalized():
|
|
lead = LeadCreateIn(phone=" 187 8617 4929 ")
|
|
assert lead.phone == "187 8617 4929"
|
|
|
|
|
|
def test_product_title_requires_two_chars():
|
|
with pytest.raises(ValidationError):
|
|
ProductCreateIn(title="A")
|