IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
211 | 211 | select={'string_length': 'LENGTH(string)'})[0] |
212 | 212 | self.assertFalse(isinstance(b5.pk, bool)) |
213 | 213 | |
| 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 | |
214 | 222 | class ChoicesTests(test.TestCase): |
215 | 223 | def test_choices_and_field_display(self): |
216 | 224 | """ |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
553 | 553 | description = _("Boolean (Either True or False)") |
554 | 554 | def __init__(self, *args, **kwargs): |
555 | 555 | kwargs['blank'] = True |
556 | | if 'default' not in kwargs and not kwargs.get('null'): |
557 | | kwargs['default'] = False |
558 | 556 | Field.__init__(self, *args, **kwargs) |
559 | 557 | |
560 | 558 | def get_internal_type(self): |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
1142 | 1142 | This attribute was confusingly named ``HttpRequest.raw_post_data``, but it |
1143 | 1143 | actually provided the body of the HTTP request. It's been renamed to |
1144 | 1144 | ``HttpRequest.body``, and ``HttpRequest.raw_post_data`` has been deprecated. |
| 1145 | |
| 1146 | ``BooleanField`` set to None when default value not specified |
| 1147 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1148 | |
| 1149 | In previous versions of Django, a model's ``BooleanField`` would get ``False`` |
| 1150 | value when no default was provided. Now ``None`` value is used. |
| 1151 | No newline at end of file |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
180 | 180 | """ |
181 | 181 | Regression test for #6755 |
182 | 182 | """ |
183 | | r = Restaurant(serves_pizza=False) |
| 183 | r = Restaurant(serves_pizza=False, serves_hot_dogs=False) |
184 | 184 | r.save() |
185 | 185 | self.assertEqual(r.id, r.place_ptr_id) |
186 | 186 | 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) |
188 | 188 | r.save() |
189 | 189 | self.assertEqual(r.id, orig_id) |
190 | 190 | self.assertEqual(r.id, r.place_ptr_id) |