1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Merge branch 'master' into lookups_3

Conflicts:
	django/db/models/fields/__init__.py
	django/db/models/sql/compiler.py
	django/db/models/sql/query.py
	tests/null_queries/tests.py
This commit is contained in:
Anssi Kääriäinen
2013-12-21 22:53:10 +02:00
387 changed files with 4383 additions and 2683 deletions

View File

@@ -5,6 +5,7 @@ import datetime
from operator import attrgetter
import pickle
import unittest
import warnings
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, connections, DEFAULT_DB_ALIAS
@@ -1139,6 +1140,17 @@ class Queries1Tests(BaseQuerysetTest):
['<Author: a1>', '<Author: a2>', '<Author: a3>', '<Author: a4>']
)
def test_callable_args(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
qs = Tag.objects.filter(name__startswith=lambda: 't')
self.assertQuerysetEqual(
qs,
['<Tag: t1>', '<Tag: t2>', '<Tag: t3>', '<Tag: t4>', '<Tag: t5>']
)
self.assertEqual(len(w), 1)
self.assertTrue(issubclass(w[0].category, PendingDeprecationWarning))
class Queries2Tests(TestCase):
def setUp(self):