diff options
author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-09-06 22:11:18 +0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-09-06 13:11:18 -0400 |
commit | 5b1c389603a353625ae1603ba345147356336afb (patch) | |
tree | 18c0729ed41490c75cb1d01eaa5de2012273b8ff /tests/serializers | |
parent | 34f27f910b2a6368e3c23324b92e6a35a4ddae3a (diff) | |
download | django-5b1c389603a353625ae1603ba345147356336afb.tar.gz |
Refs #23919 -- Replaced usage of django.utils.functional.curry() with functools.partial()/partialmethod().
Diffstat (limited to 'tests/serializers')
-rw-r--r-- | tests/serializers/test_data.py | 2 | ||||
-rw-r--r-- | tests/serializers/test_natural.py | 4 | ||||
-rw-r--r-- | tests/serializers/tests.py | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/serializers/test_data.py b/tests/serializers/test_data.py index b61dfe075f..62ce2bbfec 100644 --- a/tests/serializers/test_data.py +++ b/tests/serializers/test_data.py @@ -390,7 +390,7 @@ class SerializerDataTests(TestCase): pass -def serializerTest(format, self): +def serializerTest(self, format): # Create all the objects defined in the test data objects = [] diff --git a/tests/serializers/test_natural.py b/tests/serializers/test_natural.py index 99fc2bec9e..0c99e8e13f 100644 --- a/tests/serializers/test_natural.py +++ b/tests/serializers/test_natural.py @@ -10,7 +10,7 @@ class NaturalKeySerializerTests(TestCase): pass -def natural_key_serializer_test(format, self): +def natural_key_serializer_test(self, format): # Create all the objects defined in the test data with connection.constraint_checks_disabled(): objects = [ @@ -36,7 +36,7 @@ def natural_key_serializer_test(format, self): ) -def natural_key_test(format, self): +def natural_key_test(self, format): book1 = { 'data': '978-1590597255', 'title': 'The Definitive Guide to Django: Web Development Done Right', diff --git a/tests/serializers/tests.py b/tests/serializers/tests.py index 02184d735d..0ad95f7397 100644 --- a/tests/serializers/tests.py +++ b/tests/serializers/tests.py @@ -1,4 +1,5 @@ from datetime import datetime +from functools import partialmethod from io import StringIO from unittest import mock @@ -9,7 +10,6 @@ from django.db import connection, transaction from django.http import HttpResponse from django.test import SimpleTestCase, override_settings, skipUnlessDBFeature from django.test.utils import Approximate -from django.utils.functional import curry from .models import ( Actor, Article, Author, AuthorProfile, BaseModel, Category, ComplexModel, @@ -405,4 +405,4 @@ def register_tests(test_class, method_name, test_func, exclude=None): (exclude is None or f not in exclude)) ] for format_ in formats: - setattr(test_class, method_name % format_, curry(test_func, format_)) + setattr(test_class, method_name % format_, partialmethod(test_func, format_)) |