Added poetry integration.
Description: * Fixed github actions; * Removed requirements.txt; * Fixed CONTRIBUTING.md; * Fixed black and flake8. Signed-off-by: Pavel <win10@list.ru>
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user