Changeset 842 for trunk/tests


Ignore:
Timestamp:
Feb 8, 2016, 4:02:10 PM (4 years ago)
Author:
cito
Message:

Treat percent signs in SQL strings always the same

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_dbapi20.py

    r841 r842  
    9090        self.assertIn('.', v)
    9191        self.assertEqual(pgdb.__version__, v)
     92
     93    def test_percent_sign(self):
     94        con = self._connect()
     95        cur = con.cursor()
     96        cur.execute("select %s, 'a %% sign'", ('a % sign',))
     97        self.assertEqual(cur.fetchone(), ('a % sign', 'a % sign'))
     98        cur.execute("select 'a %% sign'")
     99        self.assertEqual(cur.fetchone(), ('a % sign',))
    92100
    93101    def test_callproc_no_params(self):
Note: See TracChangeset for help on using the changeset viewer.