@pytest.mark.django_db
def test_serialize_concept(model):
obj = model.all_objects.create(**{**fields, "id": UUID(int=0)})
serialized_data = model.get_serializer_class()(obj, context={"include_nulls": True}).data
assert serialized_data == {
"id": "00000000-0000-0000-0000-000000000000",
"url": "https://example.com/test",
"in_scheme": "https://example.com",
"pref_label": {"en": "Field"},
"broader": [],
"narrower": [],
"deprecated": None,
**{
field: extra_field_values[field]
for field in getattr(model, "serializer_extra_fields", [])
},
}