Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #1781 -- Fixed unit tests to use new error message for DoesNotE…

…xist. Thanks, pb

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0727df90f0c301c98b560766ea869802ec3802fc 1 parent 71f4568
@adrianholovaty adrianholovaty authored
View
4 tests/modeltests/basic/models.py
@@ -73,12 +73,12 @@ def __repr__(self):
>>> Article.objects.get(id__exact=2)
Traceback (most recent call last):
...
-DoesNotExist: Article does not exist for {'id__exact': 2}
+DoesNotExist: Article matching query does not exist.
>>> Article.objects.get(pub_date__year=2005, pub_date__month=8)
Traceback (most recent call last):
...
-DoesNotExist: Article does not exist for ...
+DoesNotExist: Article matching query does not exist.
# Lookup by a primary key is the most common case, so Django provides a
# shortcut for primary-key exact lookups.
View
2  tests/modeltests/custom_pk/models.py
@@ -44,7 +44,7 @@ def __repr__(self):
>>> Employee.objects.get(pk='foo')
Traceback (most recent call last):
...
-DoesNotExist: Employee does not exist for {'pk': 'foo'}
+DoesNotExist: Employee matching query does not exist.
# Use the name of the primary key, rather than pk.
>>> Employee.objects.get(employee_code__exact='ABC123')
View
2  tests/modeltests/get_latest/models.py
@@ -34,7 +34,7 @@ def __repr__(self):
>>> Article.objects.latest()
Traceback (most recent call last):
...
-DoesNotExist: Article does not exist for ...
+DoesNotExist: Article matching query does not exist.
# Create a couple of Articles.
>>> from datetime import datetime
View
2  tests/modeltests/lookup/models.py
@@ -135,7 +135,7 @@ def __repr__(self):
>>> a5.get_next_by_pub_date()
Traceback (most recent call last):
...
-DoesNotExist: Article does not exist for ...
+DoesNotExist: Article matching query does not exist.
>>> a6.get_next_by_pub_date()
Article 5
>>> a7.get_next_by_pub_date()
View
2  tests/modeltests/one_to_one/models.py
@@ -53,7 +53,7 @@ def __repr__(self):
>>> p2.restaurant
Traceback (most recent call last):
...
-DoesNotExist: Restaurant does not exist for {'place__pk': ...}
+DoesNotExist: Restaurant matching query does not exist.
# Set the place using assignment notation. Because place is the primary key on Restaurant,
# the save will create a new restaurant
Please sign in to comment.
Something went wrong with that request. Please try again.