Skip to content

Commit

Permalink
CatsAndDogs corrected to CatOrDog
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky authored Sep 8, 2021
1 parent f6d2314 commit ea773b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,13 @@ class Dog:
field = desert._fields.adjacently_tagged_union_from_registry(registry=registry)

@dataclasses.dataclass
class CatsAndDogs:
class CatOrDog:
union: t.Union[Cat, Dog] = desert.field(marshmallow_field=field)

schema = desert.schema(CatsAndDogs)
schema = desert.schema(CatOrDog)

with_a_cat = CatsAndDogs(union=Cat(name="Max", color="tuxedo"))
with_a_dog = CatsAndDogs(union=Dog(name="Bubbles", color="black spots on white"))
with_a_cat = CatOrDog(union=Cat(name="Max", color="tuxedo"))
with_a_dog = CatOrDog(union=Dog(name="Bubbles", color="black spots on white"))

marshalled_cat = {
"union": {"#type": "cat", "#value": {"name": "Max", "color": "tuxedo"}}
Expand Down

0 comments on commit ea773b7

Please sign in to comment.