diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index fd0a295..7e07c52 100644
a
|
b
|
class BooleanField(Field):
|
495 | 495 | description = _("Boolean (Either True or False)") |
496 | 496 | def __init__(self, *args, **kwargs): |
497 | 497 | kwargs['blank'] = True |
498 | | if 'default' not in kwargs and not kwargs.get('null'): |
499 | | kwargs['default'] = False |
500 | 498 | Field.__init__(self, *args, **kwargs) |
501 | 499 | |
502 | 500 | def get_internal_type(self): |
diff --git a/tests/regressiontests/model_fields/tests.py b/tests/regressiontests/model_fields/tests.py
index 72a7d4d..fae3bfd 100644
a
|
b
|
class BooleanFieldTests(unittest.TestCase):
|
193 | 193 | select={'string_length': 'LENGTH(string)'})[0] |
194 | 194 | self.assertFalse(isinstance(b5.pk, bool)) |
195 | 195 | |
| 196 | def test_null_default(self): |
| 197 | # http://code.djangoproject.com/ticket/15124 |
| 198 | from django.db import IntegrityError |
| 199 | b = BooleanModel() |
| 200 | self.assertEqual(b.bfield, None) |
| 201 | self.assertRaises(IntegrityError, b.save) |
| 202 | |
196 | 203 | class ChoicesTests(django.test.TestCase): |
197 | 204 | def test_choices_and_field_display(self): |
198 | 205 | """ |
diff --git a/tests/regressiontests/model_inheritance_regress/tests.py b/tests/regressiontests/model_inheritance_regress/tests.py
index dac2cb5..5f976ad 100644
a
|
b
|
class ModelInheritanceTest(TestCase):
|
178 | 178 | """ |
179 | 179 | Regression test for #6755 |
180 | 180 | """ |
181 | | r = Restaurant(serves_pizza=False) |
| 181 | r = Restaurant(serves_pizza=False, serves_hot_dogs=False) |
182 | 182 | r.save() |
183 | 183 | self.assertEqual(r.id, r.place_ptr_id) |
184 | 184 | orig_id = r.id |
185 | | r = Restaurant(place_ptr_id=orig_id, serves_pizza=True) |
| 185 | r = Restaurant(place_ptr_id=orig_id, serves_pizza=True, serves_hot_dogs=False) |
186 | 186 | r.save() |
187 | 187 | self.assertEqual(r.id, orig_id) |
188 | 188 | self.assertEqual(r.id, r.place_ptr_id) |