'Regression test for #10256... If there is a values() clause, Extra
columns are only returned if they are explicitly mentioned.'

def test_values_with_extra(self):

    obj = TestObject(first='first', second='second', third='third')
    obj.save()
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values()), [{'bar': u'second', 'third': u'third', 'second': u'second', 'whiz': u'third', 'foo': u'first', 'id': obj.pk, 'first': u'first'}])
    self.assertEqual(list(TestObject.objects.values().extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third'))))), [{'bar': u'second', 'third': u'third', 'second': u'second', 'whiz': u'third', 'foo': u'first', 'id': obj.pk, 'first': u'first'}])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values('first', 'second')), [{'second': u'second', 'first': u'first'}])
    self.assertEqual(list(TestObject.objects.values('first', 'second').extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third'))))), [{'second': u'second', 'first': u'first'}])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values('first', 'second', 'foo')), [{'second': u'second', 'foo': u'first', 'first': u'first'}])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values('foo', 'whiz')), [{'foo': u'first', 'whiz': u'third'}])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list()), [(u'first', u'second', u'third', obj.pk, u'first', u'second', u'third')])
    self.assertEqual(list(TestObject.objects.values_list().extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third'))))), [(u'first', u'second', u'third', obj.pk, u'first', u'second', u'third')])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('first', 'second')), [(u'first', u'second')])
    self.assertEqual(list(TestObject.objects.values_list('first', 'second').extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third'))))), [(u'first', u'second')])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('second', flat=True)), [u'second'])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('first', 'second', 'whiz')), [(u'first', u'second', u'third')])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('foo', 'whiz')), [(u'first', u'third')])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('whiz', flat=True)), [u'third'])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('whiz', 'foo')), [(u'third', u'first')])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('first', 'id')), [(u'first', obj.pk)])
    self.assertEqual(list(TestObject.objects.extra(select=SortedDict((('foo', 'first'), ('bar', 'second'), ('whiz', 'third')))).values_list('whiz', 'first', 'bar', 'id')), [(u'third', u'first', u'second', obj.pk)])
