mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #26179 -- Removed null assignment check for non-nullable foreign key fields.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user