Ejemplo n.º 1
0
    def test_get_pks_multiple(self):
        Base = declarative_base()

        class MyModel(Base):
            __tablename__ = 'blah'
            id = Column(Integer, primary_key=True)
            pk = Column(String, primary_key=True)
            value = Column(String)

        self.assertAllIn(_get_pks(MyModel), ('id', 'pk',))
Ejemplo n.º 2
0
    def test_get_pks_single(self):
        Base = declarative_base()

        class MyModel(Base):
            __tablename__ = 'blah'
            id = Column(Integer, primary_key=True)
            value = Column(String)

        resp = _get_pks(MyModel)
        self.assertAllIn(('id',), resp)
Ejemplo n.º 3
0
    def test_get_pks_single(self):
        Base = declarative_base()

        class MyModel(Base):
            __tablename__ = 'blah'
            id = Column(Integer, primary_key=True)
            value = Column(String)

        resp = _get_pks(MyModel)
        self.assertAllIn(('id', ), resp)
Ejemplo n.º 4
0
    def test_get_pks_multiple(self):
        Base = declarative_base()

        class MyModel(Base):
            __tablename__ = 'blah'
            id = Column(Integer, primary_key=True)
            pk = Column(String, primary_key=True)
            value = Column(String)

        self.assertAllIn(_get_pks(MyModel), (
            'id',
            'pk',
        ))