summaryrefslogtreecommitdiff
path: root/tests/bulk_create
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-20 09:48:31 +0200
committerGitHub <noreply@github.com>2020-07-20 09:48:31 +0200
commit83f55aafdd635189c010cff403f66b54d695921a (patch)
treeba3f3244e4300bc055555f7693363f28fa885169 /tests/bulk_create
parent730711e8282893723f993f55d3e3b0c823cfdb9a (diff)
downloaddjango-83f55aafdd635189c010cff403f66b54d695921a.tar.gz
Fixed #17653 -- Allowed using zero as AutoFields value on MySQL if NO_AUTO_VALUE_ON_ZERO SQL mode is enabled.
Diffstat (limited to 'tests/bulk_create')
-rw-r--r--tests/bulk_create/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/bulk_create/tests.py b/tests/bulk_create/tests.py
index ff89bcb1dd..2b1d901e31 100644
--- a/tests/bulk_create/tests.py
+++ b/tests/bulk_create/tests.py
@@ -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')