@@ -48,7 +48,7 @@ def test_no_init_args(self):
4848 SearchIndex ("foo" )
4949
5050 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."""
5252 msg = "SearchIndex.__init__() got an unexpected keyword argument 'condition'"
5353 with self .assertRaisesMessage (TypeError , msg ):
5454 SearchIndex (condition = "" )
@@ -62,12 +62,12 @@ def test_no_init_args(self):
6262 VectorSearchIndex ("foo" )
6363
6464 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."""
6666 msg = "VectorSearchIndex.__init__() got an unexpected keyword argument 'condition'"
6767 with self .assertRaisesMessage (TypeError , msg ):
6868 VectorSearchIndex (condition = "" )
6969
70- def test_no_similarities (self ):
70+ def test_similarities_required (self ):
7171 msg = (
7272 "VectorSearchIndex.__init__() missing 1 required keyword-only argument: 'similarities'"
7373 )
@@ -248,49 +248,6 @@ def test_multiple_fields(self):
248248 with connection .schema_editor () as editor :
249249 editor .remove_index (index = index , model = SearchIndexTestModel )
250250
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-
294251 def test_similarities_list (self ):
295252 index = VectorSearchIndex (
296253 name = "recent_test_idx" ,
0 commit comments