mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 09:06:41 +03:00
support decimal fields (fix test)
This commit is contained in:
parent
4f4ce697e4
commit
475492a65f
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||
import unittest
|
||||
from decimal import Decimal
|
||||
|
||||
from infi.clickhouse_orm.database import Database
|
||||
from infi.clickhouse_orm.database import Database, ServerError
|
||||
from infi.clickhouse_orm.models import Model
|
||||
from infi.clickhouse_orm.fields import *
|
||||
from infi.clickhouse_orm.engines import *
|
||||
|
@ -13,8 +13,15 @@ class DecimalFieldsTest(unittest.TestCase):
|
|||
|
||||
def setUp(self):
|
||||
self.database = Database('test-db')
|
||||
self.database.add_setting('allow_experimental_decimal_type', 1)
|
||||
self.database.add_setting('allow_experimental_decimal_typez', 1)
|
||||
try:
|
||||
self.database.create_table(DecimalModel)
|
||||
except ServerError as e:
|
||||
if 'Unknown setting' in e.message:
|
||||
# This ClickHouse version does not support decimals yet
|
||||
raise unittest.SkipTest(e.message)
|
||||
else:
|
||||
raise
|
||||
|
||||
def tearDown(self):
|
||||
self.database.drop_database()
|
||||
|
|
Loading…
Reference in New Issue
Block a user