@@ -48,7 +48,7 @@ def test_no_init_args(self):
48
48
SearchIndex ("foo" )
49
49
50
50
def test_no_extra_kargs (self ):
51
- """Unused wargs that appear on Index aren't accepted."""
51
+ """Unused kwargs that appear on Index aren't accepted."""
52
52
msg = "SearchIndex.__init__() got an unexpected keyword argument 'condition'"
53
53
with self .assertRaisesMessage (TypeError , msg ):
54
54
SearchIndex (condition = "" )
@@ -62,12 +62,12 @@ def test_no_init_args(self):
62
62
VectorSearchIndex ("foo" )
63
63
64
64
def test_no_extra_kargs (self ):
65
- """Unused wargs that appear on Index aren't accepted."""
65
+ """Unused kwargs that appear on Index aren't accepted."""
66
66
msg = "VectorSearchIndex.__init__() got an unexpected keyword argument 'condition'"
67
67
with self .assertRaisesMessage (TypeError , msg ):
68
68
VectorSearchIndex (condition = "" )
69
69
70
- def test_no_similarities (self ):
70
+ def test_similarities_required (self ):
71
71
msg = (
72
72
"VectorSearchIndex.__init__() missing 1 required keyword-only argument: 'similarities'"
73
73
)
@@ -248,49 +248,6 @@ def test_multiple_fields(self):
248
248
with connection .schema_editor () as editor :
249
249
editor .remove_index (index = index , model = SearchIndexTestModel )
250
250
251
- def test_similarities_value (self ):
252
- index = VectorSearchIndex (
253
- name = "recent_test_idx" ,
254
- fields = ["vector_float" , "vector_integer" ],
255
- similarities = "euclidean" ,
256
- )
257
- with connection .schema_editor () as editor :
258
- editor .add_index (index = index , model = SearchIndexTestModel )
259
- try :
260
- index_info = connection .introspection .get_constraints (
261
- cursor = None ,
262
- table_name = SearchIndexTestModel ._meta .db_table ,
263
- )
264
- expected_options = {
265
- "latestDefinition" : {
266
- "fields" : [
267
- {
268
- "numDimensions" : 10 ,
269
- "path" : "vector_float" ,
270
- "similarity" : "euclidean" ,
271
- "type" : "vector" ,
272
- },
273
- {
274
- "numDimensions" : 10 ,
275
- "path" : "vector_integer" ,
276
- "similarity" : "euclidean" ,
277
- "type" : "vector" ,
278
- },
279
- ]
280
- },
281
- "latestVersion" : 0 ,
282
- "name" : "recent_test_idx" ,
283
- "queryable" : False ,
284
- "type" : "vectorSearch" ,
285
- }
286
- self .assertCountEqual (index_info [index .name ]["columns" ], index .fields )
287
- index_info [index .name ]["options" ].pop ("id" )
288
- index_info [index .name ]["options" ].pop ("status" )
289
- self .assertEqual (index_info [index .name ]["options" ], expected_options )
290
- finally :
291
- with connection .schema_editor () as editor :
292
- editor .remove_index (index = index , model = SearchIndexTestModel )
293
-
294
251
def test_similarities_list (self ):
295
252
index = VectorSearchIndex (
296
253
name = "recent_test_idx" ,
0 commit comments