'Regression test for #8819: Fields in the extra(select=...) list
should be available to extra(order_by=...).'

def test_regression_8819(self):

    self.assertQuerysetEqual(User.objects.filter(pk=self.u.id).extra(select={u'extra_field': 1}).distinct(), [u'<User:    fred>'])
    self.assertQuerysetEqual(User.objects.filter(pk=self.u.id).extra(select={u'extra_field': 1}, order_by=[u'extra_field']), [u'<User:    fred>'])
    self.assertQuerysetEqual(User.objects.filter(pk=self.u.id).extra(select={u'extra_field': 1}, order_by=[u'extra_field']).distinct(), [u'<User:    fred>'])
