summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
diff options
context:
space:
mode:
authorTony Locke <tlocke@tlocke.org.uk>2014-08-24 16:33:29 +0100
committerTony Locke <tlocke@tlocke.org.uk>2014-12-16 20:55:55 +0000
commit8038cfa0771ff860f48967a6800477ce8a508d65 (patch)
tree5a6cf9142479488f5fc081365f387e3b91fc583a /test/dialect/postgresql
parent7cd4362924dd0133a604d4a0c52f1566acbd31ff (diff)
downloadsqlalchemy-8038cfa0771ff860f48967a6800477ce8a508d65.tar.gz
pg8000 client_encoding in create_engine()
The pg8000 dialect now supports the setting of the PostgreSQL parameter client_encoding from create_engine().
Diffstat (limited to 'test/dialect/postgresql')
-rw-r--r--test/dialect/postgresql/test_dialect.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index b751bbcdd..cf470f055 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -99,11 +99,13 @@ class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
assert 'will create implicit sequence' in msgs
assert 'will create implicit index' in msgs
- @testing.only_on('postgresql+psycopg2', 'psycopg2-specific feature')
+ @testing.only_on(
+ ['postgresql+psycopg2', 'postgresql+pg8000'],
+ 'psycopg2/pg8000-specific feature')
@engines.close_open_connections
def test_client_encoding(self):
c = testing.db.connect()
- current_encoding = c.connection.connection.encoding
+ current_encoding = c.execute("show client_encoding").fetchone()[0]
c.close()
# attempt to use an encoding that's not
@@ -115,7 +117,8 @@ class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
e = engines.testing_engine(options={'client_encoding': test_encoding})
c = e.connect()
- eq_(c.connection.connection.encoding, test_encoding)
+ new_encoding = c.execute("show client_encoding").fetchone()[0]
+ eq_(new_encoding, test_encoding)
@testing.only_on(
['postgresql+psycopg2', 'postgresql+pg8000'],