From: Damian Dimmich Date: Sat, 28 Jun 2014 16:02:24 +0000 (+0400) Subject: and tests for JSONB - as this is a superset of JSON i've subclassed X-Git-Tag: rel_1_0_0b1~349^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5092602028386c567cba62bbc857d61eb88133e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git and tests for JSONB - as this is a superset of JSON i've subclassed the JSON tests as all of these should be applicable as well. --- diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index d70a0a52f1..b11c2a46c5 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -17,7 +17,7 @@ from sqlalchemy import exc, schema, types from sqlalchemy.dialects.postgresql import base as postgresql from sqlalchemy.dialects.postgresql import HSTORE, hstore, array, \ INT4RANGE, INT8RANGE, NUMRANGE, DATERANGE, TSRANGE, TSTZRANGE, \ - JSON + JSON, JSONB import decimal from sqlalchemy import util from sqlalchemy.testing.util import round_decimal @@ -1991,3 +1991,17 @@ class JSONRoundTripTest(fixtures.TablesTest): def test_unicode_round_trip_native(self): engine = testing.db self._test_unicode_round_trip(engine) + +class JSONBTest(JSONTest): + def setup(self): + metadata = MetaData() + self.test_table = Table('test_table', metadata, + Column('id', Integer, primary_key=True), + Column('test_column', JSONB) + ) + self.jsoncol = self.test_table.c.test_column + +class JSONBRoundTripTest(JSONRoundTripTest): + __only_on__ = ('postgresql >= 9.4',) + +