magic-removal: Fixed a couple more unit-test bugs

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-30 06:07:57 +00:00
parent 104fcb2447
commit c0529945b4
2 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,7 @@ True
>>> list(Article.objects.filter(publications__title__startswith="Science")) >>> list(Article.objects.filter(publications__title__startswith="Science"))
[NASA uses Python, NASA uses Python] [NASA uses Python, NASA uses Python]
>>> list(Article.objects.filter(publications__title__startswith="Science", distinct=True)) >>> list(Article.objects.filter(publications__title__startswith="Science").distinct())
[NASA uses Python] [NASA uses Python]
# Reverse m2m queries (i.e., start at the table that doesn't have a ManyToManyField) # Reverse m2m queries (i.e., start at the table that doesn't have a ManyToManyField)
@ -106,6 +106,6 @@ True
>>> a2.delete() >>> a2.delete()
>>> list(Article.objects) >>> list(Article.objects)
[Django lets you build Web apps easily] [Django lets you build Web apps easily]
>>> list(p1.article_set.order_by=('headline')) >>> list(p1.article_set.order_by('headline'))
[Django lets you build Web apps easily] [Django lets you build Web apps easily]
""" """

View File

@ -118,7 +118,7 @@ TypeError: Cannot resolve keyword 'reporter_id' into field
>>> list(Article.objects.filter(reporter_id=1)) >>> list(Article.objects.filter(reporter_id=1))
Traceback (most recent call last): Traceback (most recent call last):
... ...
TypeError: Cannot parse keyword query 'reporter_id' TypeError: Cannot resolve keyword 'reporter_id' into field
# "pk" shortcut syntax works in a related context, too. # "pk" shortcut syntax works in a related context, too.
>>> list(Article.objects.filter(reporter__pk=1).order_by('pub_date')) >>> list(Article.objects.filter(reporter__pk=1).order_by('pub_date'))