def test_should_not_use_related_set_field_name_for_update_field_list(self):
        another_user = UserModel.objects.create(name='vova')
        another_comment = CommentModel.objects.create(
            user=another_user,
            title='goodbye',
            text='moon',
        )
        data = {
            'name': 'vova',
            'comments': [another_comment.pk]
        }
        serializer = UserSerializer(instance=another_user, data=data, partial=True)
        self.assertTrue(serializer.is_valid())
        serializer.save()
        try:
            serializer.save()
        except __HOLE__:
            self.fail('If related set field used in partial update then it should not be used in update_fields list')
        fresh_comment = CommentModel.objects.get(pk=another_comment.pk)
        fresh_user = UserModel.objects.get(pk=another_user.pk)
        self.assertEqual(fresh_comment.user, another_user)
        self.assertEqual(fresh_user.name, 'vova')
dataset/ETHPy150Open chibisov/drf-extensions/tests_app/tests/unit/serializers/tests.py/PartialUpdateSerializerMixinTest.test_should_not_use_related_set_field_name_for_update_field_list