mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #17653 -- Allowed using zero as AutoFields value on MySQL if NO_AUTO_VALUE_ON_ZERO SQL mode is enabled.
This commit is contained in:
@@ -115,7 +115,8 @@ class BulkCreateTests(TestCase):
|
||||
def test_zero_as_autoval(self):
|
||||
"""
|
||||
Zero as id for AutoField should raise exception in MySQL, because MySQL
|
||||
does not allow zero for automatic primary key.
|
||||
does not allow zero for automatic primary key if the
|
||||
NO_AUTO_VALUE_ON_ZERO SQL mode is not enabled.
|
||||
"""
|
||||
valid_country = Country(name='Germany', iso_two_letter='DE')
|
||||
invalid_country = Country(id=0, name='Poland', iso_two_letter='PL')
|
||||
|
||||
Reference in New Issue
Block a user