def test_annotate_length(self):
with override('nl'):
qs = Blog.objects.annotate(l=models.functions.Length('title_i18n'))
self.assertEquals(
list(qs.values_list('l', flat=True)),
list(map(len, ['VALK', 'VULTURE', 'BAT', 'DOLFIN', 'ZEBRA']))
)
评论列表
文章目录