Skip to content

Validation of address information in - bo.Marktlokation #532

@mj0nez

Description

@mj0nez

Currently we only validate the combination of address information if katasterinformation is given.

Steps To Reproduce

def test_address_validation_with_out_katasterinformation(self) -> None:
    with pytest.raises(ValidationError) as excinfo:
        _ = Marktlokation(
            marktlokations_id="51238696781",
            sparte=Sparte.GAS,
            lokationsadresse=Adresse(
                postleitzahl="04177",
                ort="Leipzig",
                hausnummer="1",
                strasse="Jahnalle",
            ),
            energierichtung=Energierichtung.EINSP,
            bilanzierungsmethode=Bilanzierungsmethode.PAUSCHAL,
            unterbrechbar=True,  # optional attribute
            netzebene=Netzebene.NSP,
            geoadresse=Geokoordinaten(
                breitengrad=Decimal("52"),
                laengengrad=Decimal("9"),
            ),
        )

Expected vs. Actual Behavior

What you expected

Providing a lokationsadresse and a geoadresse should raise a ValidationError.

What actually happened

The instance is created.

Additional context

Please state your Python version: 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python Specific 🐍a problem that is specific to this python implementation and not the bo4e data modelbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions