1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fix wrong attribute name in [15156]. Thanks to Alex Gaynor for spotting this.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Andrew Godwin
2011-01-10 13:44:35 +00:00
parent 937548bba4
commit ea774bf9a7
3 changed files with 5 additions and 3 deletions

View File

@@ -55,8 +55,10 @@ class GetOrCreateTests(TestCase):
# Use the publisher's primary key value instead of a model instance.
_, created = ed.books.get_or_create(name='The Great Book of Ed', publisher_id=p.id)
self.assertTrue(created)
# Try get_or_create again, this time nothing should be created.
_, created = ed.books.get_or_create(name='The Great Book of Ed', publisher_id=p.id)
self.assertFalse(created)
# The publisher should have three books.
self.assertEqual(p.books.count(), 3)