@@ -74,7 +74,7 @@ def json_headers():
7474 ]
7575
7676
77- def _create_records (db , objs , cls , pid_type ):
77+ def create_records (db , objs , cls , pid_type ):
7878 """Create records and index."""
7979 recs = []
8080 for obj in objs :
@@ -89,42 +89,42 @@ def _create_records(db, objs, cls, pid_type):
8989def testdata (app , db , search_clear , users ):
9090 """Create, index and return test data."""
9191 data = load_json_from_datadir ("locations.json" )
92- locations = _create_records (db , data , Location , LOCATION_PID_TYPE )
92+ locations = create_records (db , data , Location , LOCATION_PID_TYPE )
9393
9494 data = load_json_from_datadir ("internal_locations.json" )
95- int_locs = _create_records (db , data , InternalLocation , INTERNAL_LOCATION_PID_TYPE )
95+ int_locs = create_records (db , data , InternalLocation , INTERNAL_LOCATION_PID_TYPE )
9696
9797 data = load_json_from_datadir ("series.json" )
98- series = _create_records (db , data , Series , SERIES_PID_TYPE )
98+ series = create_records (db , data , Series , SERIES_PID_TYPE )
9999
100100 data = load_json_from_datadir ("documents.json" )
101- documents = _create_records (db , data , Document , DOCUMENT_PID_TYPE )
101+ documents = create_records (db , data , Document , DOCUMENT_PID_TYPE )
102102
103103 data = load_json_from_datadir ("items.json" )
104- items = _create_records (db , data , Item , ITEM_PID_TYPE )
104+ items = create_records (db , data , Item , ITEM_PID_TYPE )
105105
106106 data = load_json_from_datadir ("eitems.json" )
107- eitems = _create_records (db , data , EItem , EITEM_PID_TYPE )
107+ eitems = create_records (db , data , EItem , EITEM_PID_TYPE )
108108
109109 data = load_json_from_datadir ("loans.json" )
110- loans = _create_records (db , data , Loan , CIRCULATION_LOAN_PID_TYPE )
110+ loans = create_records (db , data , Loan , CIRCULATION_LOAN_PID_TYPE )
111111
112112 data = load_json_from_datadir ("acq_providers.json" )
113- acq_providers = _create_records (db , data , Provider , PROVIDER_PID_TYPE )
113+ acq_providers = create_records (db , data , Provider , PROVIDER_PID_TYPE )
114114
115115 data = load_json_from_datadir ("acq_orders.json" )
116- acq_orders = _create_records (db , data , Order , ORDER_PID_TYPE )
116+ acq_orders = create_records (db , data , Order , ORDER_PID_TYPE )
117117
118118 data = load_json_from_datadir ("ill_providers.json" )
119- ill_providers = _create_records (db , data , Provider , PROVIDER_PID_TYPE )
119+ ill_providers = create_records (db , data , Provider , PROVIDER_PID_TYPE )
120120
121121 data = load_json_from_datadir ("ill_borrowing_requests.json" )
122- ill_brw_reqs = _create_records (
122+ ill_brw_reqs = create_records (
123123 db , data , BorrowingRequest , BORROWING_REQUEST_PID_TYPE
124124 )
125125
126126 data = load_json_from_datadir ("document_requests.json" )
127- doc_reqs = _create_records (db , data , DocumentRequest , DOCUMENT_REQUEST_PID_TYPE )
127+ doc_reqs = create_records (db , data , DocumentRequest , DOCUMENT_REQUEST_PID_TYPE )
128128
129129 # index
130130 ri = RecordIndexer ()
@@ -166,7 +166,7 @@ def testdata(app, db, search_clear, users):
166166def testdata_most_loaned (db , testdata ):
167167 """Create, index and return test data for most loans tests."""
168168 most_loaned = load_json_from_datadir ("loans_most_loaned.json" )
169- recs = _create_records (db , most_loaned , Loan , CIRCULATION_LOAN_PID_TYPE )
169+ recs = create_records (db , most_loaned , Loan , CIRCULATION_LOAN_PID_TYPE )
170170
171171 ri = RecordIndexer ()
172172 for rec in recs :
@@ -184,23 +184,6 @@ def testdata_most_loaned(db, testdata):
184184 }
185185
186186
187- @pytest .fixture ()
188- def testdata_loan_histogram (db , testdata ):
189- """Create, index and return test data for loans histogram."""
190- loans_histogram = load_json_from_datadir ("loans_histogram.json" )
191- recs = _create_records (db , loans_histogram , Loan , CIRCULATION_LOAN_PID_TYPE )
192-
193- ri = RecordIndexer ()
194- for rec in recs :
195- ri .index (rec )
196-
197- current_search .flush_and_refresh (index = "loans" )
198-
199- testdata ["loans_histogram" ] = loans_histogram
200-
201- return testdata
202-
203-
204187@pytest .fixture ()
205188def item_record (app ):
206189 """Fixture to return an Item payload."""
0 commit comments