✅ Add test to ensure sa_type is not passed with sa_column
This commit is contained in:
parent
9509313eaf
commit
00b30c65c9
@ -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):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user