From cd7b54aab0c087ba6efd4a86ae0ecb6ed55d7e4b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 1 Jul 2006 03:14:33 +0000 Subject: Fixes #2271 -- Added code to imply !__exact on any query argument that doesn't finish with a known query term. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3248 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/many_to_one/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/modeltests/many_to_one/models.py b/tests/modeltests/many_to_one/models.py index b7d27e2ed3..d202975128 100644 --- a/tests/modeltests/many_to_one/models.py +++ b/tests/modeltests/many_to_one/models.py @@ -136,6 +136,10 @@ False >>> Article.objects.filter(reporter__first_name__exact='John') [, ] +# Check that implied __exact also works +>>> Article.objects.filter(reporter__first_name='John') +[, ] + # Query twice over the related field. >>> Article.objects.filter(reporter__first_name__exact='John', reporter__last_name__exact='Smith') [, ] @@ -237,6 +241,10 @@ TypeError: Cannot resolve keyword 'reporter_id' into field >>> Reporter.objects.filter(article__reporter__exact=r).distinct() [] +# Check that implied __exact also works +>>> Reporter.objects.filter(article__reporter=r).distinct() +[] + # If you delete a reporter, his articles will be deleted. >>> Article.objects.all() [, , , , ] -- cgit v1.3