From d3cf6cfacfb828faad4f4f97c904e259304649b3 Mon Sep 17 00:00:00 2001 From: Vajrasky Kok Date: Sun, 24 Nov 2013 21:12:22 +0800 Subject: Fixed #17713 -- Renamed BaseDatabaseFeatures.allows_primary_key_0 to allows_auto_pk_0. MySQL does allow primary key with value 0. It only forbids autoincrement primary key with value 0. Thanks Claude Paroz for the report. --- tests/backends/tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/backends') diff --git a/tests/backends/tests.py b/tests/backends/tests.py index 9548f60a77..d5116898ec 100644 --- a/tests/backends/tests.py +++ b/tests/backends/tests.py @@ -934,10 +934,9 @@ class ThreadTests(TestCase): class MySQLPKZeroTests(TestCase): """ 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 autoincrement primary key. """ - - @skipIfDBFeature('allows_primary_key_0') + @skipIfDBFeature('allows_auto_pk_0') def test_zero_as_autoval(self): with self.assertRaises(ValueError): models.Square.objects.create(id=0, root=0, square=1) -- cgit v1.3