From f969143c950e79ea6c71412b259118a888f1e1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Beaul=C3=A9?= Date: Wed, 24 May 2023 10:59:42 -0300 Subject: [PATCH] Make set_value a method within `Serializer` (#8001) * Make set_value a static method for Serializers As an alternative to #7671, let the method be overridden if needed. As the function is only used for serializers, it has a better place in the Serializer class. * Set `set_value` as an object (non-static) method * Add tests for set_value() These tests follow the examples given in the method. --- tests/test_serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_serializer.py b/tests/test_serializer.py index 9979c8e20..3d52f3c0a 100644 --- a/tests/test_serializer.py +++ b/tests/test_serializer.py @@ -843,4 +843,4 @@ class TestMultipleObjectsValidation(unittest.TestCase): instance=self.objs[:-1], many=True, partial=True, - ) \ No newline at end of file + )