Skip to content

Commit

Permalink
fix enum validation errors in test_enum_choices (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
xshapira authored and jonathan-s committed May 7, 2024
1 parent 2f2cd00 commit efa145c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pytest

from pydantic import ConfigDict
from testapp.models import Configuration, Listing, Preference, Record, Searchable

from pydantic import ConfigDict
from djantic import ModelSchema


Expand Down Expand Up @@ -273,7 +272,11 @@ class PreferenceSchema(ModelSchema):
}

preference = Preference.objects.create(
name="Jordan", preferred_sport="", preferred_musician=None
name="Jordan",
preferred_food="ba",
preferred_group=1,
preferred_sport="",
preferred_musician=None,
)
assert PreferenceSchema.from_django(preference).model_dump() == {
"id": 1,
Expand Down

0 comments on commit efa145c

Please sign in to comment.