mirror of
https://github.com/django/django.git
synced 2025-10-09 10:10:28 +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:
parent
730711e828
commit
83f55aafdd
7 changed files with 27 additions and 8 deletions
|
@ -32,3 +32,9 @@ class TestFeatures(TestCase):
|
|||
database_features = DatabaseFeatures(_connection)
|
||||
self.assertFalse(database_features.has_select_for_update_skip_locked)
|
||||
self.assertFalse(database_features.has_select_for_update_nowait)
|
||||
|
||||
def test_allows_auto_pk_0(self):
|
||||
with mock.MagicMock() as _connection:
|
||||
_connection.sql_mode = {'NO_AUTO_VALUE_ON_ZERO'}
|
||||
database_features = DatabaseFeatures(_connection)
|
||||
self.assertIs(database_features.allows_auto_pk_0, True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue