1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

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
This commit is contained in:
Malcolm Tredinnick 2007-05-14 21:58:01 +00:00
parent cd3d40ec91
commit 19ad4a47ba

View File

@ -154,8 +154,13 @@ False
>>> Article.objects.filter(reporter__first_name__exact='John').extra(where=["many_to_one_article__reporter.last_name='Smith'"]) >>> Article.objects.filter(reporter__first_name__exact='John').extra(where=["many_to_one_article__reporter.last_name='Smith'"])
[<Article: John's second story>, <Article: This is a test>] [<Article: John's second story>, <Article: This is a test>]
# 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'])
[<Article: John's second story>, <Article: This is a test>]
# Find all Articles for the Reporter whose ID is 1. # 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__id__exact=1)
[<Article: John's second story>, <Article: This is a test>] [<Article: John's second story>, <Article: This is a test>]
>>> Article.objects.filter(reporter__pk=1) >>> Article.objects.filter(reporter__pk=1)