def test_should_not_use_update_fields_when_related_objects_are_saving(self):
        data = {
            'title': 'goodbye',
            'user': {
                'id': self.user.pk,
                'name': 'oleg'
            }

        }
        serializer = CommentSerializerWithExpandedUsersLiked(instance=self.get_comment(), data=data, partial=True)
        self.assertTrue(serializer.is_valid())
        try:
            serializer.save()
        except __HOLE__:
            self.fail('If serializer has expanded related serializer, then it should not use update_fields while '
                      'saving related object')
        fresh_instance = self.get_comment()
        self.assertEqual(fresh_instance.title, 'goodbye')

        if get_rest_framework_features()['save_related_serializers']:
            self.assertEqual(fresh_instance.user.name, 'oleg')
dataset/ETHPy150Open chibisov/drf-extensions/tests_app/tests/unit/serializers/tests.py/PartialUpdateSerializerMixinTest.test_should_not_use_update_fields_when_related_objects_are_saving