Add test to ensure sa_type is not passed with sa_column

This commit is contained in:
Sebastián Ramírez 2023-10-29 12:00:58 +04:00
parent 9509313eaf
commit 00b30c65c9

View File

@ -39,6 +39,17 @@ def test_sa_column_no_sa_kargs() -> None:
)
def test_sa_column_no_type() -> None:
with pytest.raises(RuntimeError):
class Item(SQLModel, table=True):
id: Optional[int] = Field(
default=None,
sa_type=Integer,
sa_column=Column(Integer, primary_key=True),
)
def test_sa_column_no_primary_key() -> None:
with pytest.raises(RuntimeError):