diff options
| author | Tim Graham <timograham@gmail.com> | 2015-01-30 11:23:20 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-30 12:52:39 -0500 |
| commit | 7060ef71581c740bcc28ed405225537a411c36b5 (patch) | |
| tree | 821b8f943ffccf4925cc5b67d143b1b1069ea1e6 /tests/basic | |
| parent | 3d3c7a62c865b9a993e73a0a367134f0416283c4 (diff) | |
[1.8.x] Reverted "Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows."
This reverts commit da79ccca1d34f427952cce4555e598a700adb8de.
This optimized the unsuccessful case at the expense of the successful one.
Backport of 293fd5da5b8c7b79bd34ef793ab45c1bb8ac69ea from master
Diffstat (limited to 'tests/basic')
| -rw-r--r-- | tests/basic/tests.py | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/tests/basic/tests.py b/tests/basic/tests.py index 72fdbaa8d8..1320c22349 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -10,7 +10,7 @@ from django.db import DatabaseError from django.db.models.fields import Field from django.db.models.fields.related import ForeignObjectRel from django.db.models.manager import BaseManager -from django.db.models.query import QuerySet, EmptyQuerySet, ValuesListQuerySet, MAX_GET_RESULTS +from django.db.models.query import QuerySet, EmptyQuerySet, ValuesListQuerySet from django.test import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature from django.utils import six from django.utils.translation import ugettext_lazy @@ -178,30 +178,6 @@ class ModelTest(TestCase): self.assertNotEqual(Article.objects.get(id__exact=a1.id), Article.objects.get(id__exact=a2.id)) - def test_multiple_objects_max_num_fetched(self): - """ - #6785 - get() should fetch a limited number of results. - """ - Article.objects.bulk_create( - Article(headline='Area %s' % i, pub_date=datetime(2005, 7, 28)) - for i in range(MAX_GET_RESULTS) - ) - six.assertRaisesRegex( - self, - MultipleObjectsReturned, - "get\(\) returned more than one Article -- it returned %d!" % MAX_GET_RESULTS, - Article.objects.get, - headline__startswith='Area', - ) - Article.objects.create(headline='Area %s' % MAX_GET_RESULTS, pub_date=datetime(2005, 7, 28)) - six.assertRaisesRegex( - self, - MultipleObjectsReturned, - "get\(\) returned more than one Article -- it returned more than %d!" % MAX_GET_RESULTS, - Article.objects.get, - headline__startswith='Area', - ) - @skipUnlessDBFeature('supports_microsecond_precision') def test_microsecond_precision(self): # In PostgreSQL, microsecond-level precision is available. |
