'Make sure as_sql works with subqueries and master/slave.'

def test_subquery(self):

    sub = Person.objects.using('other').filter(name='fff')
    qs = Book.objects.filter(editor__in=sub)
    self.assertRaises(ValueError, str, qs.query)
    try:
        for obj in qs:
            pass
        self.fail('Iterating    over    query    should    raise    ValueError')
    except ValueError:
        pass
