summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-12-01 03:06:30 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-12-01 03:06:30 +0000
commitc28daf228948a04d15f30e5861a659eb8171f73f (patch)
tree53f257500698b00d8206856eb83b5697f1a00d8f /tests
parentbf0f6ec3b490fb0a9a44881f7151b3afb4ab4733 (diff)
Fixed #757: manually set AutoField values are now respected; also added unit test to verify the correct behavior. Thanks, cygnus.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/testapp/models/basic.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/testapp/models/basic.py b/tests/testapp/models/basic.py
index ad2a8cb862..80c264db86 100644
--- a/tests/testapp/models/basic.py
+++ b/tests/testapp/models/basic.py
@@ -157,6 +157,14 @@ datetime.datetime(2005, 7, 31, 12, 30, 45)
>>> a8.save()
>>> a8.id
8L
+
+# You can manually specify the primary key when creating a new objet
+>>> a101 = articles.Article(id=101, headline='Article 101', pub_date=datetime(2005, 7, 31, 12, 30, 45))
+>>> a101.save()
+>>> a101 = articles.get_object(pk=101)
+>>> a101.headline
+'Article 101'
+
"""
from django.conf import settings