summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-01-05 15:42:34 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2018-01-12 11:21:28 -0500
commitfa2f0c93e6d5be42b21aaf3c63290a276ae4cb75 (patch)
treedd06f45e5d9dbd09357a2654e49a6a93f460ece8 /lib/sqlalchemy
parent3316890ffa9a51471ca7618e4a13e45494e03198 (diff)
downloadsqlalchemy-fa2f0c93e6d5be42b21aaf3c63290a276ae4cb75.tar.gz
Turn on testing for JSON under Mariadb 10.2.7 and greater
MariaDB adds a JSON alias for the LONGTEXT datatype and all the same json functions work against it in any case. What doesn't work is reflection, since it's just an alias, and also the CAST we were using in one of our tests doesn't seem to work for JSON which is probably also because it's not a real datatype. Change-Id: I44e5503db29ca2f04de8e521527978f34675a5e0
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/testing/suite/test_types.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py
index 83aac2850..e4819cb4d 100644
--- a/lib/sqlalchemy/testing/suite/test_types.py
+++ b/lib/sqlalchemy/testing/suite/test_types.py
@@ -860,22 +860,25 @@ class JSONTest(_LiteralRoundTripFixture, fixtures.TablesTest):
)
def test_unicode_round_trip(self):
- s = select([
- cast(
+ with config.db.connect() as conn:
+ conn.execute(
+ self.tables.data_table.insert(),
+ {
+ "name": "r1",
+ "data": {
+ util.u('réveillé'): util.u('réveillé'),
+ "data": {"k1": util.u('drôle')}
+ }
+ }
+ )
+
+ eq_(
+ conn.scalar(select([self.tables.data_table.c.data])),
{
util.u('réveillé'): util.u('réveillé'),
"data": {"k1": util.u('drôle')}
},
- self.datatype
)
- ])
- eq_(
- config.db.scalar(s),
- {
- util.u('réveillé'): util.u('réveillé'),
- "data": {"k1": util.u('drôle')}
- },
- )
def test_eval_none_flag_orm(self):
from sqlalchemy.ext.declarative import declarative_base