mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-22 16:12:55 +02:00
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
"""Test Models.company."""
|
|
|
|
|
|
from aki_prj23_transparenzregister.models.company import (
|
|
Capital,
|
|
CapitalTypeEnum,
|
|
Company,
|
|
CompanyID,
|
|
CompanyTypeEnum,
|
|
CurrencyEnum,
|
|
DistrictCourt,
|
|
Location,
|
|
)
|
|
|
|
|
|
def test_to_dict() -> None:
|
|
"""Tests if the version tag is entered."""
|
|
district_court = DistrictCourt("abc", "abc")
|
|
company_id = CompanyID(district_court=district_court, hr_number="HRB 123")
|
|
location = Location(
|
|
city="Insmouth", house_number="19", street="Harbor", zip_code="1890"
|
|
)
|
|
capital = Capital(
|
|
currency=CurrencyEnum.DEUTSCHE_MARK, type=CapitalTypeEnum.GRUNDKAPITAL, value=42 # type: ignore
|
|
)
|
|
company = Company(
|
|
id=company_id,
|
|
last_update="Tomorrow",
|
|
location=location,
|
|
name="BLANK GmbH",
|
|
relationships=[],
|
|
business_purpose="Blockchain and NFTs",
|
|
capital=capital,
|
|
company_type=CompanyTypeEnum.AG, # type: ignore
|
|
founding_date="Yesterday",
|
|
)
|
|
|
|
assert company.to_dict() == {
|
|
"id": {
|
|
"district_court": district_court.to_dict(),
|
|
"hr_number": company_id.hr_number,
|
|
},
|
|
"last_update": company.last_update,
|
|
"location": {
|
|
"city": location.city,
|
|
"house_number": location.house_number,
|
|
"street": location.street,
|
|
"zip_code": location.zip_code,
|
|
},
|
|
"name": "BLANK GmbH",
|
|
"relationships": [],
|
|
"business_purpose": "Blockchain and NFTs",
|
|
"capital": {
|
|
"value": capital.value,
|
|
"currency": capital.currency,
|
|
"type": capital.type,
|
|
},
|
|
"company_type": company.company_type,
|
|
"founding_date": "Yesterday",
|
|
}
|