resolve merge conflicts

This commit is contained in:
collerek
2021-10-09 16:30:35 +02:00
62 changed files with 2797 additions and 451 deletions

View File

@ -62,18 +62,18 @@ async def cleanup():
@pytest.mark.asyncio
async def test_creating_a_position(cleanup):
async with database:
instance = PositionOrm(name="my_pos", x=1.0, y=2.0, degrees=3.0,)
instance = PositionOrm(name="my_pos", x=1.0, y=2.0, degrees=3.0)
await instance.save()
assert instance.saved
assert instance.name == "my_pos"
instance2 = PositionOrmDef(x=1.0, y=2.0, degrees=3.0,)
instance2 = PositionOrmDef(x=1.0, y=2.0, degrees=3.0)
await instance2.save()
assert instance2.saved
assert instance2.name is not None
assert len(instance2.name) == 12
instance3 = PositionOrmDef(x=1.0, y=2.0, degrees=3.0,)
instance3 = PositionOrmDef(x=1.0, y=2.0, degrees=3.0)
await instance3.save()
assert instance3.saved
assert instance3.name is not None

View File

@ -27,7 +27,7 @@ class Mol(ormar.Model):
class Meta(BaseMeta):
tablename = "mols"
id: str = ormar.UUID(primary_key=True, index=True, uuid_format="hex")
id: uuid.UUID = ormar.UUID(primary_key=True, index=True, uuid_format="hex")
smiles: str = ormar.String(nullable=False, unique=True, max_length=256)
def __init__(self, **kwargs):

View File

@ -117,7 +117,7 @@ def test_operator_return_proper_filter_action(method, expected, expected_value):
}
@pytest.mark.parametrize("method, expected_direction", [("asc", ""), ("desc", "desc"),])
@pytest.mark.parametrize("method, expected_direction", [("asc", ""), ("desc", "desc")])
def test_operator_return_proper_order_action(method, expected_direction):
action = getattr(Product.name, method)()
assert action.source_model == Product

View File

@ -126,7 +126,7 @@ class Country(ormar.Model):
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(
max_length=9, choices=country_name_choices, default="Canada",
max_length=9, choices=country_name_choices, default="Canada"
)
taxed: bool = ormar.Boolean(choices=country_taxed_choices, default=True)
country_code: int = ormar.Integer(

View File

@ -19,9 +19,9 @@ class OverwriteTest(ormar.Model):
database = database
id: int = ormar.Integer(primary_key=True)
my_int: str = ormar.Integer(overwrite_pydantic_type=PositiveInt)
my_int: int = ormar.Integer(overwrite_pydantic_type=PositiveInt)
constraint_dict: Json = ormar.JSON(
overwrite_pydantic_type=Optional[Json[Dict[str, int]]]
overwrite_pydantic_type=Optional[Json[Dict[str, int]]] # type: ignore
)

View File

@ -24,7 +24,7 @@ class ModelTest(ormar.Model):
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=200)
url: HttpUrl = "https://www.example.com"
url: HttpUrl = "https://www.example.com" # type: ignore
number: Optional[PaymentCardNumber]
@ -47,7 +47,7 @@ class ModelTest2(ormar.Model):
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=200)
url: HttpUrl = "https://www.example2.com"
url: HttpUrl = "https://www.example2.com" # type: ignore
number: PaymentCardNumber = Field(default_factory=get_number)
@ -67,7 +67,7 @@ class ModelTest3(ormar.Model):
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=200)
url: HttpUrl = "https://www.example3.com"
url: HttpUrl = "https://www.example3.com" # type: ignore
number: PaymentCardNumber
pydantic_test: PydanticTest

View File

@ -35,7 +35,7 @@ class SecondaryModel(ormar.Model):
id: int = ormar.Integer(primary_key=True)
name: str = ormar.String(max_length=100)
primary_model: PrimaryModel = ormar.ForeignKey(
PrimaryModel, related_name="secondary_models",
PrimaryModel, related_name="secondary_models"
)