From 19ad4a47ba660e5861a3a72f7b156a0653590370 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 14 May 2007 21:58:01 +0000 Subject: [PATCH] unicode: Added test to verify fix of #3492. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5243 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/many_to_one/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/modeltests/many_to_one/models.py b/tests/modeltests/many_to_one/models.py index 3040b2177a..6b5d09b714 100644 --- a/tests/modeltests/many_to_one/models.py +++ b/tests/modeltests/many_to_one/models.py @@ -154,8 +154,13 @@ False >>> Article.objects.filter(reporter__first_name__exact='John').extra(where=["many_to_one_article__reporter.last_name='Smith'"]) [, ] +# And should work fine with the unicode that comes out of +# newforms.Form.cleaned_data +>>> Article.objects.filter(reporter__first_name__exact='John').extra(where=["many_to_one_article__reporter.last_name='%s'" % u'Smith']) +[, ] + # Find all Articles for the Reporter whose ID is 1. -# Use direct ID check, pk check, and object comparison +# Use direct ID check, pk check, and object comparison >>> Article.objects.filter(reporter__id__exact=1) [, ] >>> Article.objects.filter(reporter__pk=1)