summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
diff options
context:
space:
mode:
authorDamian Dimmich <damian@tauri-tec.com>2014-06-28 23:11:03 +0400
committerDamian Dimmich <damian@tauri-tec.com>2014-06-28 23:11:03 +0400
commit4eca136e0914252a291046d8c2ed281fe6c56d94 (patch)
tree910f821dd5ed19f2b6e0542e99fb6fac4b861a53 /test/dialect/postgresql
parent4e5fcee975040d6d82baceb8e0535a548411faa6 (diff)
downloadsqlalchemy-4eca136e0914252a291046d8c2ed281fe6c56d94.tar.gz
minor cleanup of the jsonb - had extraneous operators that where copied
from hstore that don't apply. Add tests for ? and @> operators.
Diffstat (limited to 'test/dialect/postgresql')
-rw-r--r--test/dialect/postgresql/test_types.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py
index b11c2a46c..6e6e22623 100644
--- a/test/dialect/postgresql/test_types.py
+++ b/test/dialect/postgresql/test_types.py
@@ -1982,7 +1982,6 @@ class JSONRoundTripTest(fixtures.TablesTest):
},
)
-
def test_unicode_round_trip_python(self):
engine = self._non_native_engine()
self._test_unicode_round_trip(engine)
@@ -2001,6 +2000,21 @@ class JSONBTest(JSONTest):
)
self.jsoncol = self.test_table.c.test_column
+ #Note - add fixture data for arrays []
+
+ def test_where_has_key(self):
+ self._test_where(
+ # hide from 2to3
+ getattr(self.jsoncol, 'has_key')('data'),
+ "test_table.test_column ? %(test_column_1)s"
+ )
+
+ def test_where_contains(self):
+ self._test_where(
+ self.jsoncol.contains('{"k1": "r1v1"}'),
+ "test_table.test_column @> %(test_column_1)s"
+ )
+
class JSONBRoundTripTest(JSONRoundTripTest):
__only_on__ = ('postgresql >= 9.4',)