summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2009-10-24 00:37:01 +0000
committerLuke Plant <L.Plant.98@cantab.net>2009-10-24 00:37:01 +0000
commit2b2f92ae8ebd47978c132c403d8c6b617f497fb4 (patch)
treebd397fe5bb60eb9625209f543c28c0fb3229ff9d
parentb79702b2deec4ca3c625e5bffe46fa976c3c4e5f (diff)
Fixed a bug in r11646 - refs #11402
The one line of code not covered by a test... ;-) git-svn-id: http://code.djangoproject.com/svn/django/trunk@11647 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/manager.py2
-rw-r--r--tests/modeltests/lookup/models.py8
2 files changed, 9 insertions, 1 deletions
diff --git a/django/db/models/manager.py b/django/db/models/manager.py
index af48fea705..7487fa0d46 100644
--- a/django/db/models/manager.py
+++ b/django/db/models/manager.py
@@ -173,7 +173,7 @@ class Manager(object):
return self.get_query_set().only(*args, **kwargs)
def exists(self, *args, **kwargs):
- return self.get_query_ste().exists(*args, **kwargs)
+ return self.get_query_set().exists(*args, **kwargs)
def _insert(self, values, **kwargs):
return insert_query(self.model, values, **kwargs)
diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py
index 11e2b079f0..94c16ff071 100644
--- a/tests/modeltests/lookup/models.py
+++ b/tests/modeltests/lookup/models.py
@@ -17,6 +17,10 @@ class Article(models.Model):
return self.headline
__test__ = {'API_TESTS': r"""
+# We can use .exists() to check that there are none yet
+>>> Article.objects.exists()
+False
+
# Create a couple of Articles.
>>> from datetime import datetime
>>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26))
@@ -33,6 +37,10 @@ __test__ = {'API_TESTS': r"""
>>> a6.save()
>>> a7 = Article(headline='Article 7', pub_date=datetime(2005, 7, 27))
>>> a7.save()
+
+# There should be some now!
+>>> Article.objects.exists()
+True
"""}
if settings.DATABASE_ENGINE in ('postgresql', 'postgresql_pysycopg2'):