1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #13293 -- Corrected a problem with the MySQL handling of boolean return values when a query has an extra() clause. Thanks to mk for the report and draft patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-04-09 12:39:08 +00:00
parent 056c940f0d
commit e9bbdb39de
3 changed files with 11 additions and 3 deletions

View File

@@ -191,6 +191,13 @@ class BooleanFieldTests(unittest.TestCase):
self.assertTrue(isinstance(b4.nbfield, bool))
self.assertEqual(b4.nbfield, False)
# http://code.djangoproject.com/ticket/13293
# Verify that when an extra clause exists, the boolean
# conversions are applied with an offset
b5 = BooleanModel.objects.all().extra(
select={'string_length': 'LENGTH(string)'})[0]
self.assertFalse(isinstance(b5.pk, bool))
class ChoicesTests(django.test.TestCase):
def test_choices_and_field_display(self):
"""