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)
示例#2
0
    def test_array_literal_type(self):
        isinstance(postgresql.array([1, 2]).type, 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)
示例#3
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)
示例#4
0
 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)