mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 00:56:34 +03:00
Fix tests that fail on older ClickHouse versions
This commit is contained in:
parent
b2af10b11c
commit
3ec54e510c
|
@ -37,7 +37,7 @@ class AliasFieldsTest(unittest.TestCase):
|
|||
self.assertEqual(results[0].alias_int, instance.int_field)
|
||||
self.assertEqual(results[0].alias_str, instance.str_field)
|
||||
self.assertEqual(results[0].alias_date, instance.date_field)
|
||||
self.assertEqual(results[0].alias_func, '08/30/16')
|
||||
self.assertEqual(results[0].alias_func, 201608)
|
||||
|
||||
def test_assignment_error(self):
|
||||
# I can't prevent assigning at all, in case db.select statements with model provided sets model fields.
|
||||
|
@ -74,6 +74,6 @@ class ModelWithAliasFields(Model):
|
|||
alias_str = StringField(alias=u'str_field')
|
||||
alias_int = Int32Field(alias='int_field')
|
||||
alias_date = DateField(alias='date_field')
|
||||
alias_func = StringField(alias=F.formatDateTime(date_field, '%D'))
|
||||
alias_func = Int32Field(alias=F.toYYYYMM(date_field))
|
||||
|
||||
engine = MergeTree('date_field', ('date_field',))
|
||||
|
|
|
@ -168,6 +168,9 @@ class EnginesTestCase(_EnginesHelperTestCase):
|
|||
self.assertEqual('(201701, 13)'.replace(' ', ''), parts[1].partition.replace(' ', ''))
|
||||
|
||||
def test_custom_primary_key(self):
|
||||
if self.database.server_version < (18, 1):
|
||||
raise unittest.SkipTest('ClickHouse version too old')
|
||||
|
||||
class TestModel(SampleModel):
|
||||
engine = MergeTree(
|
||||
order_by=('date', 'event_id', 'event_group'),
|
||||
|
|
|
@ -560,9 +560,7 @@ class FuncsTestCase(TestCaseWithData):
|
|||
x = 17
|
||||
s = 'hello'
|
||||
url = 'http://example.com/a/b/c/d'
|
||||
self._test_func(F.hex(F.halfMD5(*args)))
|
||||
self._test_func(F.hex(F.MD5(s)))
|
||||
self._test_func(F.hex(F.sipHash64(*args)))
|
||||
self._test_func(F.hex(F.sipHash128(s)))
|
||||
self._test_func(F.hex(F.cityHash64(*args)))
|
||||
self._test_func(F.hex(F.intHash32(x)))
|
||||
|
@ -584,6 +582,9 @@ class FuncsTestCase(TestCaseWithData):
|
|||
self._test_func(F.hex(F.murmurHash3_128(s)))
|
||||
self._test_func(F.hex(F.xxHash32(*args)))
|
||||
self._test_func(F.hex(F.xxHash64(*args)))
|
||||
if self.database.server_version >= (18, 1):
|
||||
self._test_func(F.hex(F.halfMD5(*args)))
|
||||
self._test_func(F.hex(F.sipHash64(*args)))
|
||||
|
||||
def test_rand_functions(self):
|
||||
self._test_func(F.rand())
|
||||
|
|
|
@ -16,6 +16,8 @@ class UUIDFieldsTest(unittest.TestCase):
|
|||
self.database.drop_database()
|
||||
|
||||
def test_uuid_field(self):
|
||||
if self.database.server_version < (18, 1):
|
||||
raise unittest.SkipTest('ClickHouse version too old')
|
||||
# Create a model
|
||||
class TestModel(Model):
|
||||
i = Int16Field()
|
||||
|
|
Loading…
Reference in New Issue
Block a user