fix nested dicts, add more real life fastapi tests
This commit is contained in:
@ -95,13 +95,16 @@ def test_sqlalchemy_table_is_created(example):
|
||||
|
||||
def test_no_pk_in_model_definition():
|
||||
with pytest.raises(ModelDefinitionError):
|
||||
|
||||
class ExampleModel2(Model):
|
||||
__tablename__ = "example3"
|
||||
__metadata__ = metadata
|
||||
test_string = fields.String(length=250)
|
||||
|
||||
|
||||
def test_two_pks_in_model_definition():
|
||||
with pytest.raises(ModelDefinitionError):
|
||||
|
||||
class ExampleModel2(Model):
|
||||
__tablename__ = "example3"
|
||||
__metadata__ = metadata
|
||||
@ -111,6 +114,7 @@ def test_two_pks_in_model_definition():
|
||||
|
||||
def test_setting_pk_column_as_pydantic_only_in_model_definition():
|
||||
with pytest.raises(ModelDefinitionError):
|
||||
|
||||
class ExampleModel2(Model):
|
||||
__tablename__ = "example4"
|
||||
__metadata__ = metadata
|
||||
@ -119,6 +123,7 @@ def test_setting_pk_column_as_pydantic_only_in_model_definition():
|
||||
|
||||
def test_decimal_error_in_model_definition():
|
||||
with pytest.raises(ModelDefinitionError):
|
||||
|
||||
class ExampleModel2(Model):
|
||||
__tablename__ = "example4"
|
||||
__metadata__ = metadata
|
||||
@ -127,6 +132,7 @@ def test_decimal_error_in_model_definition():
|
||||
|
||||
def test_string_error_in_model_definition():
|
||||
with pytest.raises(ModelDefinitionError):
|
||||
|
||||
class ExampleModel2(Model):
|
||||
__tablename__ = "example4"
|
||||
__metadata__ = metadata
|
||||
|
||||
Reference in New Issue
Block a user