def test_option_creation(self):
        from sqlalchemy.orm.strategies import EagerLazyOption

        Customer = self.classes.Customer
        opt = orm.nestedload(Customer.orders)
        assert isinstance(opt, EagerLazyOption)
        is_(opt.key[0], Customer.orders)
Esempio n. 2
0
    def test_array_literal_type(self):
        is_(postgresql.array([1, 2]).type._type_affinity, postgresql.ARRAY)
        is_(postgresql.array([1, 2]).type.item_type._type_affinity, Integer)

        is_(postgresql.array([1, 2], type_=String).
            type.item_type._type_affinity, String)