Ticket #15124: 15124.v2.patch

File 15124.v2.patch, 3.1 KB (added by neaf, 4 years ago)

Add documentation and release notes mention.

  • tests/regressiontests/model_fields/tests.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    211211            select={'string_length': 'LENGTH(string)'})[0]
    212212        self.assertFalse(isinstance(b5.pk, bool))
    213213
     214    def test_null_default(self):
     215        # http://code.djangoproject.com/ticket/15124
     216        from django.db import IntegrityError
     217        b = BooleanModel()
     218        self.assertEqual(b.bfield, None)
     219        self.assertRaises(IntegrityError, b.save)
     220
     221
    214222class ChoicesTests(test.TestCase):
    215223    def test_choices_and_field_display(self):
    216224        """
  • django/db/models/fields/__init__.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    553553    description = _("Boolean (Either True or False)")
    554554    def __init__(self, *args, **kwargs):
    555555        kwargs['blank'] = True
    556         if 'default' not in kwargs and not kwargs.get('null'):
    557             kwargs['default'] = False
    558556        Field.__init__(self, *args, **kwargs)
    559557
    560558    def get_internal_type(self):
  • docs/releases/1.4.txt

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    11421142This attribute was confusingly named ``HttpRequest.raw_post_data``, but it
    11431143actually provided the body of the HTTP request. It's been renamed to
    11441144``HttpRequest.body``, and ``HttpRequest.raw_post_data`` has been deprecated.
     1145
     1146``BooleanField`` set to None when default value not specified
     1147~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1148
     1149In previous versions of Django, a model's ``BooleanField`` would get ``False``
     1150value when no default was provided. Now ``None`` value is used.
     1151 No newline at end of file
  • tests/regressiontests/model_inheritance_regress/tests.py

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    180180        """
    181181        Regression test for #6755
    182182        """
    183         r = Restaurant(serves_pizza=False)
     183        r = Restaurant(serves_pizza=False, serves_hot_dogs=False)
    184184        r.save()
    185185        self.assertEqual(r.id, r.place_ptr_id)
    186186        orig_id = r.id
    187         r = Restaurant(place_ptr_id=orig_id, serves_pizza=True)
     187        r = Restaurant(place_ptr_id=orig_id, serves_pizza=True, serves_hot_dogs=False)
    188188        r.save()
    189189        self.assertEqual(r.id, orig_id)
    190190        self.assertEqual(r.id, r.place_ptr_id)
Back to Top