Ejemplo n.º 1
0
 def test_with_session(self):
     assert get_bind(self.session) == self.connection
Ejemplo n.º 2
0
 def test_with_unknown_type(self):
     with raises(TypeError):
         get_bind(None)
Ejemplo n.º 3
0
 def test_with_model_object(self):
     article = self.Article()
     self.session.add(article)
     assert get_bind(article) == self.connection
Ejemplo n.º 4
0
 def test_with_connection(self, session, connection):
     assert get_bind(connection) == connection
Ejemplo n.º 5
0
 def test_with_unknown_type(self):
     with pytest.raises(TypeError):
         get_bind(None)
Ejemplo n.º 6
0
 def test_with_model_object(self, session, connection, Article):
     article = Article()
     session.add(article)
     assert get_bind(article) == connection