adding protocol version as option in tests. need to get 1.2 working properly

This commit is contained in:
Jon Haddad
2014-06-23 15:03:26 -07:00
parent 41b4cf10ae
commit 877a89d09a
2 changed files with 6 additions and 1 deletions

View File

@@ -9,7 +9,9 @@ if os.environ.get('CASSANDRA_TEST_HOST'):
else:
CASSANDRA_TEST_HOST = 'localhost'
connection.setup([CASSANDRA_TEST_HOST], default_keyspace='cqlengine_test')
protocol_version = int(os.environ.get("CASSANDRA_PROTOCOL_VERSION", 2))
connection.setup([CASSANDRA_TEST_HOST], protocol_version=protocol_version, default_keyspace='cqlengine_test')
class BaseCassEngTestCase(TestCase):

View File

@@ -56,6 +56,9 @@ Getting Started
# the list of hosts will be passed to create a Cluster() instance
>>> connection.setup(['127.0.0.1'])
# if you're connecting to a 1.2 cluster
>>> connection.setup(['127.0.0.1'], protocol_version=1)
#...and create your CQL table
>>> from cqlengine.management import sync_table
>>> sync_table(ExampleModel)