fix for bytearray being passed to blob column
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
|
|
||||||
|
0.18.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
0.18.0
|
0.18.0
|
||||||
|
|
||||||
[260] support for static columns
|
[260] support for static columns
|
||||||
@@ -8,7 +12,7 @@ CHANGELOG
|
|||||||
[256] write docs about developing cqlengine itself
|
[256] write docs about developing cqlengine itself
|
||||||
[254] use CASSANDRA_VERSION in tests
|
[254] use CASSANDRA_VERSION in tests
|
||||||
[252] memtable_flush_period_in_ms not in C 1.2 - guard against test failure
|
[252] memtable_flush_period_in_ms not in C 1.2 - guard against test failure
|
||||||
[251] test fails occasionally despite lists looking the same
|
[251] test fails occasionally despite lists looking the same
|
||||||
[246] document Batches default behaviour
|
[246] document Batches default behaviour
|
||||||
[239] add sphinx contrib module to docs
|
[239] add sphinx contrib module to docs
|
||||||
[237] update to cassandra-driver 2.1
|
[237] update to cassandra-driver 2.1
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ class Blob(Column):
|
|||||||
|
|
||||||
def to_database(self, value):
|
def to_database(self, value):
|
||||||
|
|
||||||
if not isinstance(value, six.binary_type):
|
if not isinstance(value, (six.binary_type, bytearray)):
|
||||||
raise Exception("expecting a binary, got a %s" % type(value))
|
raise Exception("expecting a binary, got a %s" % type(value))
|
||||||
|
|
||||||
val = super(Bytes, self).to_database(value)
|
val = super(Bytes, self).to_database(value)
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ class TestBlobIO(BaseColumnIOTest):
|
|||||||
pkey_val = six.b('blake'), uuid4().bytes
|
pkey_val = six.b('blake'), uuid4().bytes
|
||||||
data_val = six.b('eggleston'), uuid4().bytes
|
data_val = six.b('eggleston'), uuid4().bytes
|
||||||
|
|
||||||
|
class TestBlobIO2(BaseColumnIOTest):
|
||||||
|
|
||||||
|
column = columns.Blob
|
||||||
|
pkey_val = bytearray(six.b('blake')), uuid4().bytes
|
||||||
|
data_val = bytearray(six.b('eggleston')), uuid4().bytes
|
||||||
|
|
||||||
class TestTextIO(BaseColumnIOTest):
|
class TestTextIO(BaseColumnIOTest):
|
||||||
|
|
||||||
column = columns.Text
|
column = columns.Text
|
||||||
|
|||||||
Reference in New Issue
Block a user