Closed allynt closed 3 years ago
I did a bit of investigation into these test failures and found a couple of tests failing
AttributeError: 'tuple' object has no attribute 'items'
in overridden to_representation
method of UserSerializerBasic
.AssertionError: The
.update()method does not support writable nested fields by default
in the overriden update
mothod of UserSerializerBasic
.The former, in the to_representation
overridden method, the self
parameter when printed in the debugger states the AttributeError: 'tuple' object has no attribute 'items'
, and the error is thrown when we call the super().to_representation(instance)
The latter view test is when we test updating a user, since we have a new serializer, it cannot update it's nested fields. I'm not sure what we want here, should the customer in this case be read_only
, or do we add an update
method, to the UserSerializer
class.
@marksmall - the errors occurred b/c I didn't include the class Meta
section for my serializer. Oops. In the end, I refactored a bit more and wound up using a standard serializer (rather than a ModelSerializer) - since as of the refactoring that serializer is only used for swagger documentation purposes.
@allynt I guess your branch might be out-of-date as there are Conflicting files. If you fix those, I'm more than happy to review.
Updated swagger documentation for
UserViewSet