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

Fixed #26179 -- Removed null assignment check for non-nullable foreign key fields.

This commit is contained in:
ZachLiuGIS
2016-02-10 20:46:57 -05:00
committed by Tim Graham
parent 353aecbf8c
commit 04e13c8913
5 changed files with 32 additions and 42 deletions

View File

@@ -228,9 +228,8 @@ class OneToOneTests(TestCase):
ug_bar.place = None
self.assertIsNone(ug_bar.place)
# Assigning None fails: Place.restaurant is null=False
with self.assertRaises(ValueError):
setattr(p, 'restaurant', None)
# Assigning None will not fail: Place.restaurant is null=False
setattr(p, 'restaurant', None)
# You also can't assign an object of the wrong type here
with self.assertRaises(ValueError):