django-clickhouse/tests/settings.py

94 lines
1.9 KiB
Python
Raw Permalink Normal View History

2018-11-12 18:20:46 +03:00
"""
This file contains django settings to run tests with runtests.py
"""
SECRET_KEY = 'fake-key'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test',
'USER': 'test',
'PASSWORD': 'test',
'HOST': '127.0.0.1',
'PORT': '5432'
},
'secondary': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test2',
'USER': 'test',
'PASSWORD': 'test',
'HOST': '127.0.0.1',
'PORT': '5432'
},
# I need separate connections for multiprocessing tests
'test_db': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test_test',
'USER': 'test',
'PASSWORD': 'test',
'HOST': '127.0.0.1',
'PORT': '5432'
},
2018-11-12 18:20:46 +03:00
}
LOGGING = {
'version': 1,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django-clickhouse': {
'handlers': ['console'],
'level': 'DEBUG'
2018-11-16 11:14:40 +03:00
},
'infi.clickhouse-orm': {
'handlers': ['console'],
'level': 'INFO'
2018-11-12 18:20:46 +03:00
}
}
}
INSTALLED_APPS = [
"src",
2018-11-12 18:20:46 +03:00
"tests"
]
2018-11-15 15:37:58 +03:00
CLICKHOUSE_DATABASES = {
'default': {
'db_name': 'test',
'username': 'default',
'password': ''
},
'secondary': {
'db_name': 'test_2',
'username': 'default',
'password': ''
2018-12-18 15:33:34 +03:00
},
'no_migrate': {
'db_name': 'test_3',
'username': 'default',
'password': '',
'migrate': False
},
'readonly': {
'db_name': 'test_3',
'username': 'default',
'password': '',
'readonly': True
2018-11-15 15:37:58 +03:00
}
}
CLICKHOUSE_SYNC_BATCH_SIZE = 5000
2018-11-15 15:37:58 +03:00
CLICKHOUSE_REDIS_CONFIG = {
'host': '127.0.0.1',
'port': 6379,
'db': 8,
'socket_timeout': 10
}
DATABASE_ROUTERS = ['tests.routers.SecondaryRouter']