From c0529945b4adb71eb93b173be91541a9f6b33fe1 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 30 Jan 2006 06:07:57 +0000 Subject: [PATCH] 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 --- tests/modeltests/many_to_many/models.py | 4 ++-- tests/modeltests/many_to_one/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modeltests/many_to_many/models.py b/tests/modeltests/many_to_many/models.py index a627ec656c..ef64455910 100644 --- a/tests/modeltests/many_to_many/models.py +++ b/tests/modeltests/many_to_many/models.py @@ -76,7 +76,7 @@ True >>> list(Article.objects.filter(publications__title__startswith="Science")) [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] # Reverse m2m queries (i.e., start at the table that doesn't have a ManyToManyField) @@ -106,6 +106,6 @@ True >>> a2.delete() >>> list(Article.objects) [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] """ diff --git a/tests/modeltests/many_to_one/models.py b/tests/modeltests/many_to_one/models.py index d2bd20f8ca..b101565b04 100644 --- a/tests/modeltests/many_to_one/models.py +++ b/tests/modeltests/many_to_one/models.py @@ -118,7 +118,7 @@ TypeError: Cannot resolve keyword 'reporter_id' into field >>> list(Article.objects.filter(reporter_id=1)) 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. >>> list(Article.objects.filter(reporter__pk=1).order_by('pub_date'))