Changeset 900 for trunk/tests


Ignore:
Timestamp:
Dec 31, 2016, 3:40:24 AM (3 years ago)
Author:
cito
Message:

Allow query_formatted() to be used without parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_classic_dbwrapper.py

    r886 r900  
    954954        r = f(q, [[None]]).getresult()[0][0]
    955955        self.assertIsNone(r)
     956
     957    def testQueryFormattedWithoutParams(self):
     958        f = self.db.query_formatted
     959        q = "select 42"
     960        r = f(q).getresult()[0][0]
     961        self.assertEqual(r, 42)
     962        r = f(q, None).getresult()[0][0]
     963        self.assertEqual(r, 42)
     964        r = f(q, []).getresult()[0][0]
     965        self.assertEqual(r, 42)
     966        r = f(q, {}).getresult()[0][0]
     967        self.assertEqual(r, 42)
    956968
    957969    def testPkey(self):
Note: See TracChangeset for help on using the changeset viewer.