def METHOD_NAME(self):
    """
    Tests that errors are thrown on malformed upload payloads
    """
    self.login_as(user=self.superuser, superuser=True)
    # Structured as 'error-description' : (malformed-payload, erroring-fields)
    invalid_payloads: dict[str, tuple[dict[str, Any], list[str]]] = {
        "empty_payload": ({}, ["avatar_photo", "avatar_type"]),
        "missing_avatar_photo": (
            {"avatar_type": self.avatar_payload["avatar_type"]},
            ["avatar_photo"],
        ),
        "missing_avatar_type": (
            {"avatar_photo": self.avatar_payload["avatar_photo"]},
            ["avatar_type"],
        ),
        "invalid_avatar_type": ({**self.avatar_payload, "avatar_type": 1}, ["avatar_type"]),
    }
    for payload, fields in invalid_payloads.values():
        response = self.get_error_response(
            self.draft_doc.slug, status_code=status.HTTP_400_BAD_REQUEST, **payload
        )
        for field in fields:
            assert field in response.data.keys()