From c7ed380a3e36b1517fe3ab3fd1ae69ac8f528791 Mon Sep 17 00:00:00 2001 From: Johan Groth Date: Thu, 12 Dec 2019 11:30:05 +0100 Subject: [PATCH] test: update test with data_key --- tests/__init__.py | 2 +- tests/test_dump.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 8dcc82e..75f6ff3 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -33,7 +33,7 @@ class UserSchema(Schema): email = fields.Email() balance = fields.Decimal() registered = fields.Boolean() - hair_colors = fields.List(fields.Raw) + hair_colors = fields.List(fields.Raw, data_key="hairColors", required=True) sex_choices = fields.List(fields.Raw) finger_count = fields.Integer() uid = fields.UUID() diff --git a/tests/test_dump.py b/tests/test_dump.py index bfb5db6..6cb8aa4 100644 --- a/tests/test_dump.py +++ b/tests/test_dump.py @@ -14,7 +14,7 @@ def test_dump_schema(): props = dumped["definitions"]["UserSchema"]["properties"] for field_name, field in schema.fields.items(): - assert field_name in props + assert field.data_key or field_name in props def test_default():