Skip to content

Commit

Permalink
Fix unit tests for old database server versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jan 30, 2022
1 parent 17792e1 commit 2a03fcc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_classic_dbwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4763,8 +4763,11 @@ def testMunging(self):
self.assertNotIn('oid(t)', r)

def testQeryInformationSchema(self):
q = ("select array_agg(column_name) from information_schema.columns"
" where table_schema in ('s1', 's2', 's3', 's4')")
q = "column_name"
if self.db.server_version < 110000:
q += "::text" # old version does not have sql_identifier array
q = "select array_agg(%s) from information_schema.columns" % q
q += " where table_schema in ('s1', 's2', 's3', 's4')"
r = self.db.query(q).onescalar()
self.assertIsInstance(r, list)
self.assertEqual(set(r), set(['d', 'n'] * 8))
Expand Down

0 comments on commit 2a03fcc

Please sign in to comment.