Merge pull request #355 from kishkaru/cqlengine_fix
Cqlengine fixes to skip tests properly
This commit is contained in:
@@ -153,14 +153,19 @@ class TestDate(BaseCassEngTestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
if PROTOCOL_VERSION < 4:
|
if PROTOCOL_VERSION < 4:
|
||||||
raise unittest.SkipTest("Protocol v4 datatypes require native protocol 4+, currently using: {0}".format(PROTOCOL_VERSION))
|
return
|
||||||
|
|
||||||
sync_table(cls.DateTest)
|
sync_table(cls.DateTest)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
|
if PROTOCOL_VERSION < 4:
|
||||||
|
return
|
||||||
drop_table(cls.DateTest)
|
drop_table(cls.DateTest)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
if PROTOCOL_VERSION < 4:
|
||||||
|
raise unittest.SkipTest("Protocol v4 datatypes require native protocol 4+, currently using: {0}".format(PROTOCOL_VERSION))
|
||||||
|
|
||||||
def test_date_io(self):
|
def test_date_io(self):
|
||||||
today = date.today()
|
today = date.today()
|
||||||
self.DateTest.objects.create(test_id=0, created_at=today)
|
self.DateTest.objects.create(test_id=0, created_at=today)
|
||||||
|
|||||||
@@ -311,9 +311,11 @@ class NonModelFailureTest(BaseCassEngTestCase):
|
|||||||
with self.assertRaises(CQLEngineException):
|
with self.assertRaises(CQLEngineException):
|
||||||
sync_table(self.FakeModel)
|
sync_table(self.FakeModel)
|
||||||
|
|
||||||
|
class StaticColumnTests(BaseCassEngTestCase):
|
||||||
|
def test_static_columns(self):
|
||||||
|
if PROTOCOL_VERSION < 2:
|
||||||
|
raise unittest.SkipTest("Native protocol 2+ required, currently using: {0}".format(PROTOCOL_VERSION))
|
||||||
|
|
||||||
@unittest.skipUnless(PROTOCOL_VERSION >= 2, "only runs against the cql3 protocol v2.0")
|
|
||||||
def test_static_columns():
|
|
||||||
class StaticModel(Model):
|
class StaticModel(Model):
|
||||||
id = columns.Integer(primary_key=True)
|
id = columns.Integer(primary_key=True)
|
||||||
c = columns.Integer(primary_key=True)
|
c = columns.Integer(primary_key=True)
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ class TestQuerying(BaseCassEngTestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
if PROTOCOL_VERSION < 4:
|
if PROTOCOL_VERSION < 4:
|
||||||
raise unittest.SkipTest("Date query tests require native protocol 4+, currently using: {0}".format(PROTOCOL_VERSION))
|
return
|
||||||
|
|
||||||
super(TestQuerying, cls).setUpClass()
|
super(TestQuerying, cls).setUpClass()
|
||||||
drop_table(TestQueryModel)
|
drop_table(TestQueryModel)
|
||||||
@@ -445,9 +445,16 @@ class TestQuerying(BaseCassEngTestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
|
if PROTOCOL_VERSION < 4:
|
||||||
|
return
|
||||||
|
|
||||||
super(TestQuerying, cls).tearDownClass()
|
super(TestQuerying, cls).tearDownClass()
|
||||||
drop_table(TestQueryModel)
|
drop_table(TestQueryModel)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
if PROTOCOL_VERSION < 4:
|
||||||
|
raise unittest.SkipTest("Date query tests require native protocol 4+, currently using: {0}".format(PROTOCOL_VERSION))
|
||||||
|
|
||||||
def test_query_with_date(self):
|
def test_query_with_date(self):
|
||||||
uid = uuid4()
|
uid = uuid4()
|
||||||
day = date(2013, 11, 26)
|
day = date(2013, 11, 26)
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ from tests.integration.cqlengine.base import BaseCassEngTestCase
|
|||||||
|
|
||||||
class UserDefinedTypeTests(BaseCassEngTestCase):
|
class UserDefinedTypeTests(BaseCassEngTestCase):
|
||||||
|
|
||||||
@classmethod
|
def setUp(self):
|
||||||
def setUpClass(self):
|
|
||||||
if PROTOCOL_VERSION < 3:
|
if PROTOCOL_VERSION < 3:
|
||||||
raise unittest.SkipTest("UDTs require native protocol 3+, currently using: {0}".format(PROTOCOL_VERSION))
|
raise unittest.SkipTest("UDTs require native protocol 3+, currently using: {0}".format(PROTOCOL_VERSION))
|
||||||
|
|
||||||
|
|||||||
@@ -689,9 +689,11 @@ class TestObjectsProperty(BaseQuerySetUsage):
|
|||||||
len(TestModel.objects) # evaluate queryset
|
len(TestModel.objects) # evaluate queryset
|
||||||
assert TestModel.objects._result_cache is None
|
assert TestModel.objects._result_cache is None
|
||||||
|
|
||||||
|
class PageQueryTests(BaseCassEngTestCase):
|
||||||
|
def test_paged_result_handling(self):
|
||||||
|
if PROTOCOL_VERSION < 2:
|
||||||
|
raise unittest.SkipTest("Paging requires native protocol 2+, currently using: {0}".format(PROTOCOL_VERSION))
|
||||||
|
|
||||||
@unittest.skipUnless(PROTOCOL_VERSION >= 2, "only runs against the cql3 protocol v2.0")
|
|
||||||
def test_paged_result_handling():
|
|
||||||
# addresses #225
|
# addresses #225
|
||||||
class PagingTest(Model):
|
class PagingTest(Model):
|
||||||
id = columns.Integer(primary_key=True)
|
id = columns.Integer(primary_key=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user