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:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user