54 lines
1.5 KiB
Python

"""Test Models.company."""
from aki_prj23_transparenzregister.models.company import (
Capital,
Company,
CompanyID,
Location,
)
def test_to_dict() -> None:
"""Tests if the version tag is entered."""
company_id = CompanyID("The Shire", "420")
location = Location(
city="Insmouth", house_number="19", street="Harbor", zip_code="1890"
)
capital = Capital(currency="BTC", type="Virtual assets", value=42)
company = Company(
id=company_id,
last_update="Tomorrow",
location=location,
name="BLANK GmbH",
relationships=[],
business_purpose="Blockchain and NFTs",
capital=capital,
company_type="Something",
founding_date="Yesterday",
)
assert company.to_dict() == {
"id": {
"district_court": company_id.district_court,
"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": "Something",
"founding_date": "Yesterday",
}