Пример #1
0
 def test_with_relationship(self, model_factory):
     Parent = model_factory(name='Parent')
     child_cols = [
         Column('parent_id', ForeignKey('parent.id')),
     ]
     child_rels = {'parent': relationship(Parent, backref='children')}
     Child = model_factory(child_cols, 'Child', relationships=child_rels)
     assert sorted(util.get_pks(Child)) == ['id']
Пример #2
0
 def test_with_relationship(self, model_factory):
     Parent = model_factory(name='Parent')
     child_cols = [
         Column('parent_id', ForeignKey('parent.id')),
     ]
     child_rels = {'parent': relationship(Parent, backref='children')}
     Child = model_factory(child_cols, 'Child', relationships=child_rels)
     assert sorted(util.get_pks(Child)) == ['id']
Пример #3
0
 def test_single_pk(self, Model_one_pk):
     assert sorted(util.get_pks(Model_one_pk)) == ['id']
Пример #4
0
 def test_different_colname(self, Model_diff_colname):
     assert sorted(util.get_pks(Model_diff_colname)) == ['id']
Пример #5
0
 def test_multiple_pks(self, Model_two_pk):
     assert sorted(util.get_pks(Model_two_pk)) == ['id', 'id2']
Пример #6
0
 def test_single_pk(self, Model_one_pk):
     assert sorted(util.get_pks(Model_one_pk)) == ['id']
Пример #7
0
 def test_different_colname(self, Model_diff_colname):
     assert sorted(util.get_pks(Model_diff_colname)) == ['id']
Пример #8
0
 def test_multiple_pks(self, Model_two_pk):
     assert sorted(util.get_pks(Model_two_pk)) == ['id', 'id2']