U
    |h˸                     @   s  d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZ d dlmZ ddlmZ z(d d	lmZ d d
lmZ d dlmZ W n ek
r   dZY nX edkZerddiZndddiiZeed  dkdG dd deeZeed  dkdG dd deZeed  dkdG dd deZeed  dkdG dd deZeed  dkdG dd deZeed  dkde dG dd deZ!dS )     N)mock)Q)TestCase)	MATCH_ALLFuzzyPhrase)models   )%ElasticsearchCommonSearchBackendTests)VERSION)JSONSerializer)Elasticsearch7SearchBackend)r   r   r   )      queryQUERYbodyr   zElasticsearch 7 requiredc                   @   s   e Zd ZdZdS )TestElasticsearch7SearchBackendz&wagtail.search.backends.elasticsearch7N)__name__
__module____qualname__backend_path r   r   x/var/www/dating/data/www/fatepal.com/env/lib/python3.8/site-packages/wagtail/search/tests/test_elasticsearch7_backend.pyr   !   s   r   c                       s<  e Zd ZdZdd Ze fddZdd Zdd	 Zd
d Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8d9 Z d:d; Z!d<d= Z"d>d? Z#d@dA Z$dBdC Z%dDdE Z&dFdG Z'dHdI Z(  Z)S )JTestElasticsearch7SearchQueryNc                 C   s0   t  j}| tj|d|dtj|d|d d S NT)	sort_keysdefaultr   r   assertEqualjsondumpsselfabr   r   r   r   assertDictEqual*   s
    z-TestElasticsearch7SearchQuery.assertDictEqualc                    s   t    tj| _tj| _d S N)super
setUpClassr   query_compiler_class!autocomplete_query_compiler_class)cls	__class__r   r   r)   1   s    
z(TestElasticsearch7SearchQuery.setUpClassc                 C   sL   |  tjj d}ddddiidddgdd	id
i}| | | d S )NHelloboolmatchcontent_typesearchtests.Bookmulti_match	_all_text_all_text_boost_2_0^2.0fieldsr   filtermustr*   r   Bookobjectsallr&   	get_queryr#   r   expected_resultr   r   r   test_simple9   s    
z)TestElasticsearch7SearchQuery.test_simplec                 C   sJ   |  tjj d}ddddiiddddiiidi}| | | d S )	Nr/   r0   r1   r2   r3   _edgengramsr   r9   )r+   r   r=   r>   r?   r&   r@   rA   r   r   r   test_simple_autocompleteN   s     
 
 z6TestElasticsearch7SearchQuery.test_simple_autocompletec                 C   sB   |  tjj t}ddddiidi idi}| | | d S Nr0   r1   r2   r3   Z	match_allr9   )r+   r   r=   r>   r?   r   r&   r@   rA   r   r   r   test_match_all_autocompletec   s    
 
z9TestElasticsearch7SearchQuery.test_match_all_autocompletec              	   C   s:   |  tjj td}| t |  W 5 Q R X d S )Nr/   )	r+   r   r=   r>   r?   r   ZassertRaisesNotImplementedErrorr@   )r#   r   r   r   r   'test_non_supported_queries_autocompleter   s    
 zETestElasticsearch7SearchQuery.test_non_supported_queries_autocompletec                 C   sB   |  tjj t}ddddiidi idi}| | | d S rF   )r*   r   r=   r>   r?   r   r&   r@   rA   r   r   r   test_none_query_string|   s    
z4TestElasticsearch7SearchQuery.test_none_query_stringc                 C   sR   | j tjj ddd}ddddiidd	d
gdddidi}| | | d S )Nr/   and)operatorr0   r1   r2   r3   r4   r5   r6   r8   r   rL   r9   r<   rA   r   r   r   test_and_operator   s$    
  
z/TestElasticsearch7SearchQuery.test_and_operatorc                 C   s\   |  tjjjddd}ddddiidd	diigd
ddgddidi}| | | d S )NTesttitler/   r0   r1   r2   r3   termtitle_filterr4   r5   r6   r7   r9   r*   r   r=   r>   r:   r&   r@   rA   r   r   r   test_filter   s$     

z)TestElasticsearch7SearchQuery.test_filterc              	   C   s   |  tjjjdtddddd}ddd	d
iidddddiidddiigiigdddgddidi}| }|d d d d d }t|dd d|d d < | 	|| d S )NrO     
      )rQ   publication_dater/   r0   r1   r2   r3   r;   rR   publication_date_filter
2017-10-18rS   r4   r5   r6   r7   r9   r:   r	   c                 S   s   t | d  d S NrR   r   listkeysfr   r   r   <lambda>       z?TestElasticsearch7SearchQuery.test_and_filter.<locals>.<lambda>key)
r*   r   r=   r>   r:   datetimedater@   sortedr&   )r#   r   rB   field_filtersr   r   r   test_and_filter   sB     	


 z-TestElasticsearch7SearchQuery.test_and_filterc                 C   s   |  tjjtddttddddB d}| }|d d	 d
 d d }t	|dd d|d d < ddddiidddddiidddiigiigdddgddidi}| 
|| d S )NrO   rP   rV   rW   rX   rY   r/   r0   r:   r	   Zshouldc                 S   s   t | d  d S r\   r]   r`   r   r   r   rb      rc   z>TestElasticsearch7SearchQuery.test_or_filter.<locals>.<lambda>rd   r1   r2   r3   rR   rZ   r[   rS   r4   r5   r6   r7   r9   )r*   r   r=   r>   r:   r   rf   rg   r@   rh   r&   )r#   r   ri   rB   r   r   r   test_or_filter   s@     


z,TestElasticsearch7SearchQuery.test_or_filterc                 C   sn   |  tjjjtddddd}dddd	iidd
dddiiiigdddgddidi}| | | d S )NrV   rW   rX   rk   r/   r0   r1   r2   r3   mustNotrR   rZ   r[   r4   r5   r6   r7   r9   )	r*   r   r=   r>   excluderf   rg   r&   r@   rA   r   r   r   test_negated_filter  s0    
 z1TestElasticsearch7SearchQuery.test_negated_filterc                 C   sR   | j tjj ddgd}ddddiiddddd	iid
i}| | | d S )Nr/   rQ   r8   r0   r1   r2   r3          @r   boostr9   r<   rA   r   r   r   test_fields3  s"    
  
z)TestElasticsearch7SearchQuery.test_fieldsc                 C   sV   | j tjj ddgdd}ddddiidddd	dd
iidi}| | | d S )Nr/   rQ   rK   r8   rL   r0   r1   r2   r3   rq   )r   rs   rL   r9   r<   rA   r   r   r   test_fields_with_and_operatorI  s&    
   
z;TestElasticsearch7SearchQuery.test_fields_with_and_operatorc                 C   sT   | j tjj dddgd}ddddiid	d
dgddidi}| | | d S )Nr/   rQ   summaryrp   r0   r1   r2   r3   r4   	title^2.0r7   r9   r<   rA   r   r   r   test_multiple_fields`  s"    
  
z2TestElasticsearch7SearchQuery.test_multiple_fieldsc                 C   sX   | j tjj dddgdd}dddd	iid
ddgdddidi}| | | d S )Nr/   rQ   rw   rK   ru   r0   r1   r2   r3   r4   rx   rM   r9   r<   rA   r   r   r   &test_multiple_fields_with_and_operatorw  s&    
	
zDTestElasticsearch7SearchQuery.test_multiple_fields_with_and_operatorc                 C   s\   |  tjjjddd}ddddiidd	diigd
ddgddidi}| | | d S )NrO   )Ztitle__exactr/   r0   r1   r2   r3   rR   rS   r4   r5   r6   r7   r9   rT   rA   r   r   r   test_exact_lookup  s$     

z/TestElasticsearch7SearchQuery.test_exact_lookupc                 C   sd   |  tjjjd dd}ddddiidddd	d
iiiigdddgddidi}| | | d S )NrP   r/   r0   r1   r2   r3   rm   existsfieldrS   r4   r5   r6   r7   r9   rT   rA   r   r   r   test_none_lookup  s$     
z.TestElasticsearch7SearchQuery.test_none_lookupc                 C   sd   |  tjjjddd}ddddiiddd	d
diiiigdddgddidi}| | | d S )NTZtitle__isnullr/   r0   r1   r2   r3   rm   r|   r}   rS   r4   r5   r6   r7   r9   rT   rA   r   r   r   test_isnull_true_lookup  s$     
z5TestElasticsearch7SearchQuery.test_isnull_true_lookupc                 C   s\   |  tjjjddd}ddddiidd	d
iigdddgddidi}| | | d S )NFr   r/   r0   r1   r2   r3   r|   r}   rS   r4   r5   r6   r7   r9   rT   rA   r   r   r   test_isnull_false_lookup  s$     

z6TestElasticsearch7SearchQuery.test_isnull_false_lookupc                 C   s\   |  tjjjddd}ddddiidd	diigd
ddgddidi}| | | d S )NrO   )Ztitle__startswithr/   r0   r1   r2   r3   prefixrS   r4   r5   r6   r7   r9   rT   rA   r   r   r   test_startswith_lookup  s$     

z4TestElasticsearch7SearchQuery.test_startswith_lookupc                 C   sj   |  tjjjtddddd}dddd	iid
dddiiigdddgddidi}| | | d S )N        )Zpublication_date__gtr/   r0   r1   r2   r3   rangerZ   gt
2014-04-29r4   r5   r6   r7   r9   r*   r   r=   r>   r:   rf   r&   r@   rA   r   r   r   test_gt_lookup  s(    	
z,TestElasticsearch7SearchQuery.test_gt_lookupc                 C   sj   |  tjjjtddddd}dddd	iid
dddiiigdddgddidi}| | | d S )Nr   r   r   )Zpublication_date__ltr/   r0   r1   r2   r3   r   rZ   ltr   r4   r5   r6   r7   r9   r   rA   r   r   r   test_lt_lookup3  s(    	
z,TestElasticsearch7SearchQuery.test_lt_lookupc                 C   sj   |  tjjjtddddd}dddd	iid
dddiiigdddgddidi}| | | d S )Nr   r   r   )Zpublication_date__gter/   r0   r1   r2   r3   r   rZ   gter   r4   r5   r6   r7   r9   r   rA   r   r   r   test_gte_lookupP  s(    	
z-TestElasticsearch7SearchQuery.test_gte_lookupc                 C   sj   |  tjjjtddddd}dddd	iid
dddiiigdddgddidi}| | | d S )Nr   r   r   )Zpublication_date__lter/   r0   r1   r2   r3   r   rZ   lter   r4   r5   r6   r7   r9   r   rA   r   r   r   test_lte_lookupm  s(    	
z-TestElasticsearch7SearchQuery.test_lte_lookupc                 C   s   t  ddd}t  ddd}| tjjj||fdd}dd	d
diidddddiigdddgddidi}| | | d S )Nr   r   r         )Zpublication_date__ranger/   r0   r1   r2   r3   r   rZ   r   z
2014-08-19)r   r   r4   r5   r6   r7   r9   )rf   r*   r   r=   r>   r:   r&   r@   )r#   Z
start_dateend_dater   rB   r   r   r   test_range_lookup  s4    
z/TestElasticsearch7SearchQuery.test_range_lookupc                 C   s8   | j tjjdddd}ddig}| | | d S )NrY   r/   FZorder_by_relevancerZ   ascr*   r   r=   r>   Zorder_byr&   get_sortrA   r   r   r   test_custom_ordering  s    
z2TestElasticsearch7SearchQuery.test_custom_orderingc                 C   s8   | j tjjdddd}ddig}| | | d S )Nz-publication_dater/   Fr   rZ   descr   rA   r   r   r   test_custom_ordering_reversed  s    
z;TestElasticsearch7SearchQuery.test_custom_ordering_reversedc                 C   s@   | j tjjddddd}ddiddig}| | | d S )	NrY   Znumber_of_pagesr/   Fr   rZ   r   number_of_pages_filterr   rA   r   r   r   test_custom_ordering_multiple  s    z;TestElasticsearch7SearchQuery.test_custom_ordering_multiplec                 C   s@   |  tjj td}dddgdddi}| | | d S )NHello worldr4   r5   r6   phrase)r8   r   typer*   r   r=   r>   r?   r   r&   get_inner_queryr#   Zquery_compilerrB   r   r   r   test_phrase_query  s    
 
z/TestElasticsearch7SearchQuery.test_phrase_queryc                 C   sH   | j tjj tdddgd}ddddgddi}| | | d S )	Nr   rQ   rw   rp   r4   rx   r   )r   r8   r   r   r   r   r   r   !test_phrase_query_multiple_fields  s    

z?TestElasticsearch7SearchQuery.test_phrase_query_multiple_fieldsc                 C   sD   | j tjj tddgd}dddddii}| | | d S )Nr   rQ   rp   Zmatch_phraserq   rr   r   r   r   r   r   test_phrase_query_single_field  s    
  z<TestElasticsearch7SearchQuery.test_phrase_query_single_fieldc                 C   s@   |  tjj td}dddgdddi}| | | d S )Nr   r4   r5   r6   AUTOr8   r   	fuzzinessr*   r   r=   r>   r?   r   r&   r   r   r   r   r   test_fuzzy_query  s    

z.TestElasticsearch7SearchQuery.test_fuzzy_queryc                 C   sF   | j tjj tddgd}ddddddii}| | | d S )Nr   rQ   rp   r1   r   rq   )r   r   rs   r   r   r   r   r   test_fuzzy_query_single_field#  s    
	z;TestElasticsearch7SearchQuery.test_fuzzy_query_single_fieldc                 C   sH   | j tjj tdddgd}dddgdddi}| | | d S )	Nr   rQ   rw   rp   r4   rx   r   r   r   r   r   r   r    test_fuzzy_query_multiple_fields7  s    

z>TestElasticsearch7SearchQuery.test_fuzzy_query_multiple_fieldsc                 C   s`   |  tjjjddd}ddddiidd	d
diiigdddgddidi}| | | d S )Nil  )Zpublication_date__year__ltr/   r0   r1   r2   r3   r   rZ   r   z
1900-01-01r4   r5   r6   r7   r9   rT   r   r   r   r   test_year_filterK  s$     
z.TestElasticsearch7SearchQuery.test_year_filter)*r   r   r   maxDiffr&   classmethodr)   rC   rE   rG   rI   rJ   rN   rU   rj   rl   ro   rt   rv   ry   rz   r{   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __classcell__r   r   r-   r   r   &   sL   
,+!%r   c                   @   s   e Zd ZdgZdd Zdd Zdd Zedd	d
 Z	eddd Z
eddd Zeddd Zeddd Zeddd Zeddd Zeddd Zeddd Zeddd Zeddd ZdS ) TestElasticsearch7SearchResultssearchc                 C   s&   t  j}| tj|d|dtj d S r   r   r"   r   r   r   r&   j  s    z/TestElasticsearch7SearchResults.assertDictEqualc                 C   s:   t i }t }tjj |_d|j_	d |j
_	|||S )Nr   )r   r   Z	MagicMockr   r=   r>   r?   Zquerysetr@   return_valuer   Zresults_class)r#   backendr   r   r   r   get_resultsn  s    z+TestElasticsearch7SearchResults.get_resultsc                 C   s,   dddddd |D dt |ddd	d
S )Nr      )ZfailedZ
successfultotalc              	   S   s.   g | ]&}d t | ddddt |gidqS )zsearchtests_book:Zwagtailr	   Zsearchtests_bookpk)Z_id_indexZ_score_typer8   )str).0resultr   r   r   
<listcomp>z  s   

 zMTestElasticsearch7SearchResults.construct_search_response.<locals>.<listcomp>r	   )hitsZ	max_scorer   F   )Z_shardsr   Z	timed_outZtook)len)r#   resultsr   r   r   construct_search_responsev  s    

z9TestElasticsearch7SearchResults.construct_search_responsez"elasticsearch.Elasticsearch.searchc                 C   s<   |  g |_|  }t| |jf ddddddt d S )NFr   wagtail__searchtests_bookZ2md   )_sourcestored_fieldsindexscrollsizer   r   r   r^   assert_any_callsearch_query_kwargsr#   r   r   r   r   r   test_basic_search  s    z1TestElasticsearch7SearchResults.test_basic_searchc                 C   s>   |  dg|_|  }|d  |jf ddddddt d S )Nr	   rW   Fr   r   Zfrom_r   r   r   r   r   r   r   r   r   r   r   r   r   test_get_single_item  s    z4TestElasticsearch7SearchResults.test_get_single_itemc                 C   sD   |  g |_|  dd }t| |jf ddddddt d S )Nr	   r   Fr   r      r   r   r   r   r   r   test_slice_results  s    z2TestElasticsearch7SearchResults.test_slice_resultsc                 C   sL   |  g |_|  dd  d d }t| |jf ddddddt d S )NrW   Fr   r   r   r   r   r   r   r   !test_slice_results_multiple_times  s    zATestElasticsearch7SearchResults.test_slice_results_multiple_timesc                 C   sF   |  dg|_|  dd  }|d  |jf ddddddt d S )Nr	   rW      Fr   r   r   r   r   r   r   r   test_slice_results_and_get_item  s    z?TestElasticsearch7SearchResults.test_slice_results_and_get_itemc                 C   s6   |  dg|_|  }| |d tjjjdd d S )Nr	   r   id)r   r   r   r   r   r=   r>   getr   r   r   r   test_result_returned  s    z4TestElasticsearch7SearchResults.test_result_returnedc                 C   s*   |  dg|_|  }| t|d d S )Nr	   r   r   r   r   r   r   r   r   r   
test_len_1  s    z*TestElasticsearch7SearchResults.test_len_1c                 C   s,   |  ddg|_|  }| t|d d S )Nr	   r   r   r   r   r   r   
test_len_2  s    z*TestElasticsearch7SearchResults.test_len_2c                 C   sh   |  ddg|_t|  }| t|d | |d tjjj	dd | |d tjjj	dd d S )Nr	   r   r   r   )
r   r   r^   r   r   r   r   r=   r>   r   r   r   r   r   test_duplicate_results  s    z6TestElasticsearch7SearchResults.test_duplicate_resultsc                 C   sv   |  dddg|_t|  }| |d tjjjdd | |d tjjjdd | |d tjjjdd d S )Nr	   r   r   r   r   	r   r   r^   r   r   r   r=   r>   r   r   r   r   r   test_result_order  s    z1TestElasticsearch7SearchResults.test_result_orderc                 C   sv   |  dddg|_t|  }| |d tjjjdd | |d tjjjdd | |d tjjjdd d S )Nr   r   r	   r   r   r   r   r   r   r   test_result_order_2
  s    z3TestElasticsearch7SearchResults.test_result_order_2N)r   r   r   fixturesr&   r   r   r   patchr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   f  s4   











r   c                   @   sF   e Zd ZdgZdZdd Zdd Zdd Zd	d
 Zdd Z	dd Z
dS )TestElasticsearch7Mappingr   Nc                 C   s0   t  j}| tj|d|dtj|d|d d S r   r   r"   r   r   r   r&     s
    z)TestElasticsearch7Mapping.assertDictEqualc                 C   s$   t tj| _tjjjdd| _d S Nr   r   )r   mapping_classr   r=   
es_mappingr>   r   objr#   r   r   r   setUp#  s    zTestElasticsearch7Mapping.setUpc                 C   s   |  | j d d S Ndocr   r   Zget_document_typer   r   r   r   test_get_document_type*  s    z0TestElasticsearch7Mapping.test_get_document_typec                 C   s   | j  }ddddddiddiddidddd	dd
dgdddddddiddd
ddddd	ddiddddiddid
ddddiddd
dddiddddidi}| || d S )N
propertieskeywordTr   storer   textedgengram_analyzerstandardanalyzersearch_analyzerr   r5   _all_text_boost_2_0r   copy_tor   r   r   nestedrg   nameZname_edgengramsZdate_of_birth_filterr   r   integerr   r   r  Zslug_filter)r   r2   r5   r   rD   rQ   title_edgengramsrS   authorsauthors_filterrZ   rw   r   tagstags_filterr   Zget_mappingr&   r#   mappingrB   r   r   r   test_get_mapping-  sP    
0z*TestElasticsearch7Mapping.test_get_mappingc                 C   s"   |  | j| jt| jj d S r'   r   r   Zget_document_idr   r   r   r   r   r   r   test_get_document_idd  s    z.TestElasticsearch7Mapping.test_get_document_idc                 C   sx   | j | j}d|kr"|d   ddgddgdddddtdddd	gd
gtdddddg g d}| || d S )NrD   4r3   J. R. R. TolkienThe Fellowship of the Ringd  r	   r   r  r     r   r      )r   r2   rD   rQ   r  rS   r  r	  rZ   rw   r   r
  r  r   Zget_documentr   sortrf   rg   r&   r#   ZdocumentrB   r   r   r   test_get_documentg  s0    z+TestElasticsearch7Mapping.test_get_documentr   r   r   r   r   r&   r   r   r  r  r  r   r   r   r   r     s   7r   c                   @   sF   e Zd ZdgZdZdd Zdd Zdd Zd	d
 Zdd Z	dd Z
dS )$TestElasticsearch7MappingInheritancer   Nc                 C   s0   t  j}| tj|d|dtj|d|d d S r   r   r"   r   r   r   r&     s
    z4TestElasticsearch7MappingInheritance.assertDictEqualc                 C   s$   t tj| _tjjjdd| _d S r   )r   r   r   ZNovelr   r>   r   r   r   r   r   r   r     s    z*TestElasticsearch7MappingInheritance.setUpc                 C   s   |  | j d d S r   r   r   r   r   r   r     s    z;TestElasticsearch7MappingInheritance.test_get_document_typec                 C   s  | j  }dddddddddddd	gdd
diddd
didddddgdiddddd
did
did
did
did
didddddddgdddddd
diddddddddd
diddd
did
did
didddddddd
diddd
didi}| || d S )Nr   r   r5   r   r   r   r   r   _all_text_boost_0_5r   r  r  Znovel_id_filterr  r  _all_text_boost_0_25r   Tr   r   r   rg   r  r  r  )searchtests_novel__setting%searchtests_novel__setting_edgengramssearchtests_novel__protagonist(searchtests_novel__protagonist_id_filtersearchtests_novel__charactersr   r2   r5   r!  r  r   rD   rQ   r  rS   r  r	  rZ   r   rw   r
  r  r  r  r   r   r   r    s    


Qz5TestElasticsearch7MappingInheritance.test_get_mappingc                 C   s"   |  | j| jt| jj d S r'   r  r   r   r   r   r    s    z9TestElasticsearch7MappingInheritance.test_get_document_idc                 C   s   | j | j}d|kr"|d   d|kr>|d jdd d ddddd	d
ddiddiddigddgdddgddddddtddddgdgtdddddg g d}| || d S )NrD   r&  c                 S   s   | d S )Nr  r   )cr   r   r   rb   	  rc   zHTestElasticsearch7MappingInheritance.test_get_document.<locals>.<lambda>rd   zMiddle EarthzFrodo Bagginsr   r   r   r  zBilbo BagginsZGandalfzsearchtests.Novelr3   r  r  r  r  r	   r   r  r   r  r   r   r  r  )r"  r#  r$  r%  r&  r2   rD   r   rQ   r  rS   r  r	  rZ   r   rw   r
  r  r  r  r   r   r   r    sJ    )z6TestElasticsearch7MappingInheritance.test_get_documentr  r   r   r   r   r    s   Xr  z4wagtail.search.backends.elasticsearch7.Elasticsearchc                   @   s$   e Zd Zdd Zdd Zdd ZdS )TestBackendConfigurationc                 C   s,   t i d |jdddddd dgdd d S )	Nparams	localhosti#  r  FhostportZ
url_prefixuse_sslverify_certsZ	http_authrW   hoststimeoutr   Zassert_called_withr#   ZElasticsearchr   r   r   test_default_settings;  s    

z.TestBackendConfiguration.test_default_settingsc                 C   s8   t ddddddgid |jdddddgdd d S )	NZHOSTS	127.0.0.1iT$  T)r-  r.  r/  r0  r)  rW   r1  r4  r5  r   r   r   
test_hostsL  s&    z#TestBackendConfiguration.test_hostsc                 C   sh   t dddddgid |jddd	d
d
d dddd	ddd dddd	d
d
dddddddd dgdd d S )NZURLSzhttp://localhost:12345zhttps://127.0.0.1:54321z1http://username:password@elasticsearch.mysite.comz&https://elasticsearch.mysite.com/hellor)  r+  i90  r  Fr,  r7  i1  Tzelasticsearch.mysite.comP   )usernamepasswordi  z/hellorW   r1  r4  r5  r   r   r   	test_urlsf  sR    			"z"TestBackendConfiguration.test_urlsN)r   r   r   r6  r8  r<  r   r   r   r   r(  8  s   r(  )"rf   r    Zunittestr   Zdjango.db.modelsr   Zdjango.testr   Zwagtail.search.queryr   r   r   Zwagtail.test.searchr   Zelasticsearch_common_testsr
   Zelasticsearchr   ZELASTICSEARCH_VERSIONZelasticsearch.serializerr   Z&wagtail.search.backends.elasticsearch7r   ImportErrorZuse_new_elasticsearch_apir   ZskipIfr   r   r   r   r  r   r(  r   r   r   r   <module>   sR   
       E 0u ,