adds some tests for to_model

This commit is contained in:
Mouse Reeve
2020-12-07 12:19:15 -08:00
parent f61fcb1261
commit 6817babf3c
2 changed files with 69 additions and 22 deletions

View File

@ -104,14 +104,12 @@ class ActivityObject:
one_to_many_fields[field.name] = value
elif isinstance(model_field, ImageFileDescriptor):
# image fields need custom handling
print(model_field, field.name, value)
image_fields[field.name] = value
else:
if value == MISSING:
value = None
mapped_fields[field.name] = value
if instance:
# updating an existing model instance
for k, v in mapped_fields.items():