From 19e67c6cd13d6442abb2a6eba1b7fba80dcf5457 Mon Sep 17 00:00:00 2001 From: Rolo Date: Thu, 4 Jun 2015 11:24:53 +0100 Subject: Fixed #24677 -- Made TextField.to_python() return a string. This is consistent with CharField. --- tests/model_fields/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 3e59f6465b..939ba269d8 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -246,6 +246,13 @@ class ManyToManyFieldTests(test.SimpleTestCase): ) +class TextFieldTests(test.TestCase): + def test_to_python(self): + """TextField.to_python() should return a string""" + f = models.TextField() + self.assertEqual(f.to_python(1), '1') + + class DateTimeFieldTests(test.TestCase): def test_datetimefield_to_python_usecs(self): """DateTimeField.to_python should support usecs""" -- cgit v1.3