mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Refs #23919 -- Removed misc Python 2/3 references.
This commit is contained in:
parent
11856ea44e
commit
1c466994d9
22 changed files with 62 additions and 115 deletions
|
@ -40,6 +40,12 @@ class Money(decimal.Decimal):
|
|||
)
|
||||
|
||||
|
||||
class TestModel1(object):
|
||||
def upload_to(self):
|
||||
return '/somewhere/dynamic/'
|
||||
thing = models.FileField(upload_to=upload_to)
|
||||
|
||||
|
||||
class OperationWriterTests(SimpleTestCase):
|
||||
|
||||
def test_empty_signature(self):
|
||||
|
@ -472,21 +478,12 @@ class WriterTests(SimpleTestCase):
|
|||
self.assertEqual(string, 'range')
|
||||
self.assertEqual(imports, set())
|
||||
|
||||
def test_serialize_local_function_reference(self):
|
||||
"""
|
||||
Neither py2 or py3 can serialize a reference in a local scope.
|
||||
"""
|
||||
class TestModel2:
|
||||
def upload_to(self):
|
||||
return "somewhere dynamic"
|
||||
thing = models.FileField(upload_to=upload_to)
|
||||
with self.assertRaises(ValueError):
|
||||
self.serialize_round_trip(TestModel2.thing)
|
||||
def test_serialize_unbound_method_reference(self):
|
||||
"""An unbound method used within a class body can be serialized."""
|
||||
self.serialize_round_trip(TestModel1.thing)
|
||||
|
||||
def test_serialize_local_function_reference_message(self):
|
||||
"""
|
||||
Make sure user is seeing which module/function is the issue
|
||||
"""
|
||||
def test_serialize_local_function_reference(self):
|
||||
"""A reference in a local scope can't be serialized."""
|
||||
class TestModel2:
|
||||
def upload_to(self):
|
||||
return "somewhere dynamic"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue