Refs #23919 -- Removed misc Python 2/3 references.

This commit is contained in:
Tim Graham 2017-01-25 13:59:25 -05:00 committed by GitHub
parent 11856ea44e
commit 1c466994d9
22 changed files with 62 additions and 115 deletions

View file

@ -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"