Coverage for tests/test_enums_models.py: 100%
17 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 00:02 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 00:02 +0000
1import enum 1abcdefghijklmnopqr
2import uuid 1abcdefghijklmnopqr
4from sqlmodel import Field, SQLModel 1abcdefghijklmnopqr
7class MyEnum1(str, enum.Enum): 1abcdefghijklmnopqr
8 A = "A" 1abcdefghijklmnopqr
9 B = "B" 1abcdefghijklmnopqr
12class MyEnum2(str, enum.Enum): 1abcdefghijklmnopqr
13 C = "C" 1abcdefghijklmnopqr
14 D = "D" 1abcdefghijklmnopqr
17class BaseModel(SQLModel): 1abcdefghijklmnopqr
18 id: uuid.UUID = Field(primary_key=True) 1abcdefghijklmnopqr
19 enum_field: MyEnum2 1abcdefghijklmnopqr
22class FlatModel(SQLModel, table=True): 1abcdefghijklmnopqr
23 id: uuid.UUID = Field(primary_key=True) 1abcdefghijklmnopqr
24 enum_field: MyEnum1 1abcdefghijklmnopqr
27class InheritModel(BaseModel, table=True): 1abcdefghijklmnopqr
28 pass 1abcdefghijklmnopqr