diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-21 02:33:46 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-21 02:33:46 +0000 |
| commit | db94402ea69fb3ba14288441cd28938c568586f5 (patch) | |
| tree | 7e08eaec6a24888652f4900e5aef72e580523b7f /tests | |
| parent | 270377cb37e3bbe5f2432cdab94fe955ace099ea (diff) | |
Added unit tests to verify #800. Refs #800
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1324 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/testapp/models/lookup.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/testapp/models/lookup.py b/tests/testapp/models/lookup.py index 6d8ede1905..f8445c4f60 100644 --- a/tests/testapp/models/lookup.py +++ b/tests/testapp/models/lookup.py @@ -122,4 +122,19 @@ Article 7 Article 2 >>> a2.get_previous_by_pub_date() Article 1 + +# Underscores and percent signs have special meaning in the underlying +# database library, but Django handles the quoting of them automatically. +>>> a8 = articles.Article(headline='Article_ with underscore', pub_date=datetime(2005, 11, 20)) +>>> a8.save() +>>> articles.get_list(headline__startswith='Article') +[Article_ with underscore, Article 5, Article 6, Article 4, Article 2, Article 3, Article 7, Article 1] +>>> articles.get_list(headline__startswith='Article_') +[Article_ with underscore] +>>> a9 = articles.Article(headline='Article% with percent sign', pub_date=datetime(2005, 11, 21)) +>>> a9.save() +>>> articles.get_list(headline__startswith='Article') +[Article% with percent sign, Article_ with underscore, Article 5, Article 6, Article 4, Article 2, Article 3, Article 7, Article 1] +>>> articles.get_list(headline__startswith='Article%') +[Article% with percent sign] """ |
