Refs #24031 -- Added test for When.__repr__().

This commit is contained in:
Mads Jensen 2017-09-15 12:13:38 +02:00 committed by Tim Graham
parent 116940e3ef
commit 1dafd8cb0b
1 changed files with 4 additions and 0 deletions

View File

@ -1338,6 +1338,10 @@ class ReprTests(TestCase):
repr(Case(When(a=1))),
"<Case: CASE WHEN <Q: (AND: ('a', 1))> THEN Value(None), ELSE Value(None)>"
)
self.assertEqual(
repr(When(Q(age__gte=18), then=Value('legal'))),
"<When: WHEN <Q: (AND: ('age__gte', 18))> THEN Value(legal)>"
)
self.assertEqual(repr(Col('alias', 'field')), "Col(alias, field)")
self.assertEqual(repr(F('published')), "F(published)")
self.assertEqual(repr(F('cost') + F('tax')), "<CombinedExpression: F(cost) + F(tax)>")