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'))