kopia lustrzana https://github.com/wagtail/wagtail
Added Elasticsearch 5 backend tests
rodzic
f07b032881
commit
93cc470d4b
|
@ -19,6 +19,7 @@ def make_parser():
|
|||
parser.add_argument('--postgres', action='store_true')
|
||||
parser.add_argument('--elasticsearch', action='store_true')
|
||||
parser.add_argument('--elasticsearch2', action='store_true')
|
||||
parser.add_argument('--elasticsearch5', action='store_true')
|
||||
parser.add_argument('rest', nargs='*')
|
||||
return parser
|
||||
|
||||
|
@ -58,6 +59,9 @@ def runtests():
|
|||
elif args.elasticsearch2:
|
||||
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
|
||||
os.environ.setdefault('ELASTICSEARCH_VERSION', '2')
|
||||
elif args.elasticsearch5:
|
||||
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
|
||||
os.environ.setdefault('ELASTICSEARCH_VERSION', '5')
|
||||
elif 'ELASTICSEARCH_URL' in os.environ:
|
||||
# forcibly delete the ELASTICSEARCH_URL setting to skip those tests
|
||||
del os.environ['ELASTICSEARCH_URL']
|
||||
|
|
|
@ -171,7 +171,9 @@ WAGTAILSEARCH_BACKENDS = {
|
|||
AUTH_USER_MODEL = 'customuser.CustomUser'
|
||||
|
||||
if 'ELASTICSEARCH_URL' in os.environ:
|
||||
if os.environ.get('ELASTICSEARCH_VERSION') == '2':
|
||||
if os.environ.get('ELASTICSEARCH_VERSION') == '5':
|
||||
backend = 'wagtail.wagtailsearch.backends.elasticsearch5'
|
||||
elif os.environ.get('ELASTICSEARCH_VERSION') == '2':
|
||||
backend = 'wagtail.wagtailsearch.backends.elasticsearch2'
|
||||
else:
|
||||
backend = 'wagtail.wagtailsearch.backends.elasticsearch'
|
||||
|
|
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue