1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

[1.8.x] Refs #14030 -- Improved expression support for python values

Backport of e2d6e14662 from master
This commit is contained in:
Josh Smeaton
2015-02-11 16:38:02 +11:00
parent 343c087533
commit a6ea62aeaf
7 changed files with 89 additions and 88 deletions

View File

@@ -281,7 +281,7 @@ class FunctionTests(TestCase):
def test_substr_with_expressions(self):
Author.objects.create(name='John Smith', alias='smithj')
Author.objects.create(name='Rhonda')
authors = Author.objects.annotate(name_part=Substr('name', V(5), V(3)))
authors = Author.objects.annotate(name_part=Substr('name', 5, 3))
self.assertQuerysetEqual(
authors.order_by('name'), [
' Sm',