diff --git a/tests/db_functions/tests.py b/tests/db_functions/tests.py
index 4331e02..eaf0401 100644
a
|
b
|
from decimal import Decimal
|
3 | 3 | from unittest import skipIf, skipUnless |
4 | 4 | |
5 | 5 | from django.db import connection |
6 | | from django.db.models import CharField, TextField, Value as V |
| 6 | from django.db.models import CharField, F, TextField, Value as V |
7 | 7 | from django.db.models.expressions import RawSQL |
8 | 8 | from django.db.models.functions import ( |
9 | 9 | Coalesce, Concat, ConcatPair, Greatest, Least, Length, Lower, Now, |
… |
… |
class FunctionTests(TestCase):
|
519 | 519 | lambda a: a.name_part |
520 | 520 | ) |
521 | 521 | |
| 522 | def test_substr_with_startswith(self): |
| 523 | a = Author.objects.create(name='John Smith', alias='John') |
| 524 | authors = Author.objects.filter(name__startswith=Substr(F('alias'), 1, 3)) |
| 525 | self.assertCountEqual(authors, [a]) |
| 526 | |
522 | 527 | def test_nested_function_ordering(self): |
523 | 528 | Author.objects.create(name='John Smith') |
524 | 529 | Author.objects.create(name='Rhonda Simpson', alias='ronny') |