Changeset 875 for trunk/tests


Ignore:
Timestamp:
Jul 2, 2016, 4:46:03 AM (3 years ago)
Author:
cito
Message:

Let connect() pass any other connection parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_dbapi20.py

    r871 r875  
    8080        dbapi20.DatabaseAPI20Test.tearDown(self)
    8181
    82     def testVersion(self):
     82    def test_version(self):
    8383        v = pgdb.version
    8484        self.assertIsInstance(v, str)
    8585        self.assertIn('.', v)
    8686        self.assertEqual(pgdb.__version__, v)
     87
     88    def test_connect_kwargs(self):
     89        application_name = 'PyGreSQL DB API 2.0 Test'
     90        self.connect_kw_args['application_name'] = application_name
     91        con = self._connect()
     92        cur = con.cursor()
     93        cur.execute("select application_name from pg_stat_activity"
     94            " where application_name = %s", (application_name,))
     95        self.assertEqual(cur.fetchone(), (application_name,))
    8796
    8897    def test_percent_sign(self):
Note: See TracChangeset for help on using the changeset viewer.