Add fixtures; minor changes

This commit is contained in:
Daniil Fajnberg 2022-10-03 09:17:29 +02:00
parent cf83e0074e
commit 81a55ba452
11 changed files with 102 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class DB:
force_auto_coercion()
@property
def engine(self):
def engine(self) -> Engine:
if self._engine is None:
self.start_engine()
assert isinstance(self._engine, (AsyncEngine, Engine))

View File

@ -36,7 +36,7 @@ class LegalForm(AbstractBase, table=True):
# Fields
short: str = Field(max_length=32, nullable=False, index=True)
name: Optional[str] = Field(default=None, max_length=255, sa_column=Column(Unicode(255)))
country: str = Field(sa_column=Column(CountryType))
country: Optional[str] = Field(sa_column=Column(CountryType))
# Relationships
subcategories: list['LegalFormSubcategory'] = Relationship(

5
tests/fixtures/companies/company.json vendored Normal file
View File

@ -0,0 +1,5 @@
[
{
}
]

View File

View File

@ -0,0 +1,9 @@
[
{
"id": 1,
"name": "Energy"
}, {
"id": 2,
"name": "Retail"
}
]

View File

@ -0,0 +1,16 @@
[
{
"id": 1,
"short": "KG",
"name": "Kommanditgesellschaft",
"country": "DE"
}, {
"id": 2,
"short": "AG",
"name": "Aktiengesellschaft",
"country": "DE"
}, {
"id": 123,
"short": "Ausl.HRB"
}
]

View File

@ -0,0 +1,17 @@
[
{
"id": 111,
"short": "GmbH & Co. KG",
"name": "Gesellschaft mit beschränkter Haftung & Compagnie Kommanditgesellschaft",
"legal_form_id": 1
}, {
"id": 112,
"short": "AG & Co. KG",
"name": "Aktiengesellschaft & Compagnie Kommanditgesellschaft",
"legal_form_id": 1
}, {
"id": 69420,
"short": "LLC",
"legal_form_id": 123
}
]

8
tests/fixtures/geography/address.json vendored Normal file
View File

@ -0,0 +1,8 @@
[
{
"id": 9999999,
"house_number": "123AB",
"supplement": "whatever",
"street_id": 1
}
]

23
tests/fixtures/geography/city.json vendored Normal file
View File

@ -0,0 +1,23 @@
[
{
"id": 1122,
"zip_code": "10405",
"name": "Berlin",
"state_province_id": 100
}, {
"id": 9,
"zip_code": "33299",
"name": "Miami",
"state_province_id": 30
}, {
"id": 10,
"zip_code": "33694",
"name": "Tampa",
"state_province_id": 30
}, {
"id": 78787878,
"zip_code": "91000",
"name": "Luhansk",
"state_province_id": 4531354
}
]

View File

@ -0,0 +1,15 @@
[
{
"id": 100,
"country": "DE",
"name": "Berlin"
}, {
"id": 30,
"country": "US",
"name": "Florida"
}, {
"id": 4531354,
"country": "UA",
"name": "Luhansk Oblast"
}
]

7
tests/fixtures/geography/street.json vendored Normal file
View File

@ -0,0 +1,7 @@
[
{
"id": 1,
"name": "Some Street",
"city_id": 1122
}
]