Refs #29451 -- Quoted MySQL column names in tests.

This commit is contained in:
Tom Forbes 2018-06-05 11:13:29 +01:00 committed by Carlton Gibson
parent 1fac974067
commit a253a580e6
1 changed files with 2 additions and 2 deletions

View File

@ -1636,7 +1636,7 @@ class Queries5Tests(TestCase):
['<Ranking: 1: a3>', '<Ranking: 2: a2>', '<Ranking: 3: a1>']
)
qs = Ranking.objects.extra(select={'good': 'case when rank > 2 then 1 else 0 end'})
qs = Ranking.objects.extra(select={'good': 'case when `rank` > 2 then 1 else 0 end'})
self.assertEqual(
[o.good for o in qs.extra(order_by=('-good',))],
[True, False, False]
@ -1657,7 +1657,7 @@ class Queries5Tests(TestCase):
def test_ticket7256(self):
# An empty values() call includes all aliases, including those from an
# extra()
qs = Ranking.objects.extra(select={'good': 'case when rank > 2 then 1 else 0 end'})
qs = Ranking.objects.extra(select={'good': 'case when `rank` > 2 then 1 else 0 end'})
dicts = qs.values().order_by('id')
for d in dicts:
del d['id']