You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# -*- coding: utf-8 -*-
# @Time : 2026/1/9 15:27
# @Author : zhaoxiangpeng
# @File : test_queryJson.py
from pprint import pprint
from science_article_cnki . models import cnki_model as model
def test_add_con ( ) :
years = [ 2022 , 2023 , 2024 ]
init_params = {
' query ' : ' (作者单位:西南科技大学(模糊)) ' ,
' filters ' : [
dict ( project = " 年度 " , value = years , text_or_title = [ f " { y } 年 " for y in years ] )
]
}
m = init_params
filters = m . get ( ' filters ' )
query_body = model . adv_refine_search ( * * m )
for f in filters :
model . add_muti_group ( * * f , base_query = query_body )
f2 = dict ( project = " 年度 " , value = 2025 , text_or_title = f " { 2025 } 年 " )
model . add_muti_group ( * * f2 , base_query = query_body )
f3 = dict ( project = " 年度 " , value = [ 2023 , 2025 ] , text_or_title = [ " 2023年 " , " 2025年 " ] )
model . add_muti_group ( * * f3 , base_query = query_body )
# f4 = dict(project="来源类别", value="CSSCI", text_or_title="CSSCI")
# model.add_muti_group(**f4, base_query=query_body)
pprint ( query_body )
return query_body