diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-01-23 04:31:02 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-01-23 04:31:02 +0000 |
| commit | a670fccf79217405e34155319e03d1ed1e2e1390 (patch) | |
| tree | 7bb1be426d74893771c90e1e7d4219665e61bb17 /tests | |
| parent | 8c4c07b5d0f56c2f9359923606305141cf9be99c (diff) | |
newforms-admin: Merged to [4399]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4400 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/lookup/models.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py index 09c3aa7aa8..aa903d1a64 100644 --- a/tests/modeltests/lookup/models.py +++ b/tests/modeltests/lookup/models.py @@ -191,4 +191,19 @@ DoesNotExist: Article matching query does not exist. >>> Article.objects.filter(headline__contains='\\') [<Article: Article with \ backslash>] +# none() returns an EmptyQuerySet that behaves like any other QuerySet object +>>> Article.objects.none() +[] +>>> Article.objects.none().filter(headline__startswith='Article') +[] +>>> Article.objects.none().count() +0 + +# using __in with an empty list should return an empty query set +>>> Article.objects.filter(id__in=[]) +[] + +>>> Article.objects.exclude(id__in=[]) +[<Article: Article with \ backslash>, <Article: Article% with percent sign>, <Article: Article_ with underscore>, <Article: Article 5>, <Article: Article 6>, <Article: Article 4>, <Article: Article 2>, <Article: Article 3>, <Article: Article 7>, <Article: Article 1>] + """} |
