def test_with_subquery(self):
        number_of_sales = (sa.select(
            [sa.func.count(self.Article.id)], ).select_from(
                self.Article.__table__)).label('number_of_articles')

        query = self.session.query(self.User, number_of_sales)
        assert list(query_entities(query)) == [self.User]
    def test_with_subquery(self):
        number_of_sales = (
            sa.select(
                [sa.func.count(self.Article.id)],
            )
            .select_from(
                self.Article.__table__
            )
        ).label('number_of_articles')

        query = self.session.query(self.User, number_of_sales)
        assert list(query_entities(query)) == [self.User]
 def test_aliased_entity(self):
     query = self.session.query(sa.orm.aliased(self.User))
     assert list(query_entities(query)) == [self.User]
 def test_joins(self):
     query = self.session.query(self.User.__mapper__).join(self.Article)
     assert list(query_entities(query)) == [self.User, self.Article]
 def test_mapper(self):
     query = self.session.query(self.User.__mapper__)
     assert list(query_entities(query)) == [self.User]
 def test_column_entity_with_label(self):
     query = self.session.query(self.User.id.label('id'))
     assert list(query_entities(query)) == [self.User]
 def test_column_entity(self):
     query = self.session.query(self.User.id)
     assert list(query_entities(query)) == [self.User]
 def test_simple_query(self):
     query = self.session.query(self.User)
     assert list(query_entities(query)) == [self.User]
 def test_aliased_entity(self):
     query = self.session.query(sa.orm.aliased(self.User))
     assert list(query_entities(query)) == [self.User]
 def test_joins(self):
     query = self.session.query(self.User.__mapper__).join(self.Article)
     assert list(query_entities(query)) == [self.User, self.Article]
 def test_mapper(self):
     query = self.session.query(self.User.__mapper__)
     assert list(query_entities(query)) == [self.User]
 def test_column_entity_with_label(self):
     query = self.session.query(self.User.id.label('id'))
     assert list(query_entities(query)) == [self.User]
 def test_column_entity(self):
     query = self.session.query(self.User.id)
     assert list(query_entities(query)) == [self.User]
 def test_simple_query(self):
     query = self.session.query(self.User)
     assert list(query_entities(query)) == [self.User]