| 120 | |
| 121 | |
| 122 | def test_values(sql_context): |
| 123 | db, dialect, is_psycopg = sql_context |
| 124 | sql = IntFields.filter(intnum=1).values("intnum").sql() |
| 125 | if dialect == "mysql": |
| 126 | expected = "SELECT `intnum` `intnum` FROM `intfields` WHERE `intnum`=%s" |
| 127 | elif dialect == "postgres": |
| 128 | if is_psycopg: |
| 129 | expected = 'SELECT "intnum" "intnum" FROM "intfields" WHERE "intnum"=%s' |
| 130 | else: |
| 131 | expected = 'SELECT "intnum" "intnum" FROM "intfields" WHERE "intnum"=$1' |
| 132 | else: |
| 133 | expected = 'SELECT "intnum" "intnum" FROM "intfields" WHERE "intnum"=?' |
| 134 | assert sql == expected |
| 135 | |
| 136 | |
| 137 | def test_values_list(sql_context): |