Esempio n. 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']
Esempio n. 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']
Esempio n. 3
0
 def test_single_pk(self, Model_one_pk):
     assert sorted(util.get_pks(Model_one_pk)) == ['id']
Esempio n. 4
0
 def test_different_colname(self, Model_diff_colname):
     assert sorted(util.get_pks(Model_diff_colname)) == ['id']
Esempio n. 5
0
 def test_multiple_pks(self, Model_two_pk):
     assert sorted(util.get_pks(Model_two_pk)) == ['id', 'id2']
Esempio n. 6
0
 def test_single_pk(self, Model_one_pk):
     assert sorted(util.get_pks(Model_one_pk)) == ['id']
Esempio n. 7
0
 def test_different_colname(self, Model_diff_colname):
     assert sorted(util.get_pks(Model_diff_colname)) == ['id']
Esempio n. 8
0
 def test_multiple_pks(self, Model_two_pk):
     assert sorted(util.get_pks(Model_two_pk)) == ['id', 'id2']