MCPcopy
hub / github.com/psycopg/psycopg / test_compose_literal

Method test_compose_literal

tests/test_sql.py:114–117  ·  view source on GitHub ↗
(self, conn)

Source from the content-addressed store, hash-verified

112 assert s1 == 'select "field" from "table"'
113
114 def test_compose_literal(self, conn):
115 s = sql.SQL("select {0};").format(sql.Literal(dt.date(2016, 12, 31)))
116 s1 = s.as_string(conn)
117 assert s1 == "select '2016-12-31'::date;"
118
119 def test_compose_empty(self, conn):
120 s = sql.SQL("select foo;").format()

Callers

nothing calls this directly

Calls 2

formatMethod · 0.80
as_stringMethod · 0.45

Tested by

no test coverage detected