44from django .db import connection
55from django .test import TestCase
66
7- from django_mongodb_backend .indexes import AtlasSearchIndex , AtlasVectorSearchIndex
7+ from django_mongodb_backend .indexes import SearchIndex , VectorSearchIndex
88
99from .models import Article , Data
1010
@@ -34,7 +34,7 @@ def assertAddRemoveIndex(self, editor, model, index):
3434
3535 def test_simple (self ):
3636 with connection .schema_editor () as editor :
37- index = AtlasSearchIndex (
37+ index = SearchIndex (
3838 name = "recent_article_idx" ,
3939 fields = ["number" ],
4040 )
@@ -43,7 +43,7 @@ def test_simple(self):
4343
4444 def test_multiple_fields (self ):
4545 with connection .schema_editor () as editor :
46- index = AtlasSearchIndex (
46+ index = SearchIndex (
4747 name = "recent_article_idx" ,
4848 fields = ["headline" , "number" , "body" , "data" , "embedded" , "auto_now" ],
4949 )
@@ -83,7 +83,7 @@ def test_multiple_fields(self):
8383 self .assertAddRemoveIndex (editor , Article , index )
8484
8585 def test_field_not_exists (self ):
86- index = AtlasSearchIndex (
86+ index = SearchIndex (
8787 name = "recent_article_idx" ,
8888 fields = ["headline" , "non_existing_name" ],
8989 )
@@ -137,7 +137,7 @@ def assertAddRemoveIndex(self, editor, model, index):
137137
138138 def test_simple (self ):
139139 with connection .schema_editor () as editor :
140- index = AtlasSearchIndex (
140+ index = SearchIndex (
141141 name = "recent_article_idx" ,
142142 fields = ["number" ],
143143 )
@@ -146,7 +146,7 @@ def test_simple(self):
146146
147147 def test_multiple_fields (self ):
148148 with connection .schema_editor () as editor :
149- index = AtlasSearchIndex (
149+ index = SearchIndex (
150150 name = "recent_article_idx" ,
151151 fields = ["headline" , "number" , "body" , "data" , "embedded" , "auto_now" ],
152152 )
@@ -186,7 +186,7 @@ def test_multiple_fields(self):
186186 self .assertAddRemoveIndex (editor , Article , index )
187187
188188
189- class AtlasSearchIndexTests (TestCase ):
189+ class SearchIndexTests (TestCase ):
190190 # Schema editor is used to create the index to test that it works.
191191 # available_apps = ["indexes"]
192192 available_apps = None # could be removed?
@@ -209,9 +209,9 @@ def assertAddRemoveIndex(self, editor, model, index):
209209 ),
210210 )
211211
212- def test_simple_atlas_vector_search (self ):
212+ def test_simple_vector_search (self ):
213213 with connection .schema_editor () as editor :
214- index = AtlasVectorSearchIndex (
214+ index = VectorSearchIndex (
215215 name = "recent_article_idx" ,
216216 fields = ["number" ],
217217 )
@@ -220,7 +220,7 @@ def test_simple_atlas_vector_search(self):
220220
221221 def test_multiple_fields (self ):
222222 with connection .schema_editor () as editor :
223- index = AtlasVectorSearchIndex (
223+ index = VectorSearchIndex (
224224 name = "recent_article_idx" ,
225225 fields = ["headline" , "number" , "body" , "description_embedded" ],
226226 )
@@ -255,7 +255,7 @@ def test_multiple_fields(self):
255255 self .assertAddRemoveIndex (editor , Article , index )
256256
257257 def test_field_not_exists (self ):
258- index = AtlasVectorSearchIndex (
258+ index = VectorSearchIndex (
259259 name = "recent_article_idx" ,
260260 fields = ["headline" , "non_existing_name" , "title_embedded" ],
261261 )
@@ -267,7 +267,7 @@ def test_field_not_exists(self):
267267 editor .add_index (index = index , model = Article )
268268
269269
270- class AtlasSearchIndexTestsWithData (TestCase ):
270+ class SearchIndexTestsWithData (TestCase ):
271271 available_apps = None # could be removed?
272272
273273 @classmethod
@@ -307,9 +307,9 @@ def assertAddRemoveIndex(self, editor, model, index):
307307 ),
308308 )
309309
310- def test_simple_atlas_vector_search (self ):
310+ def test_simple_vector_search (self ):
311311 with connection .schema_editor () as editor :
312- index = AtlasVectorSearchIndex (
312+ index = VectorSearchIndex (
313313 name = "recent_article_idx" ,
314314 fields = ["number" ],
315315 )
@@ -318,7 +318,7 @@ def test_simple_atlas_vector_search(self):
318318
319319 def test_multiple_fields (self ):
320320 with connection .schema_editor () as editor :
321- index = AtlasVectorSearchIndex (
321+ index = VectorSearchIndex (
322322 name = "recent_article_idx" ,
323323 fields = ["headline" , "number" , "body" , "description_embedded" ],
324324 )
@@ -367,7 +367,7 @@ def test_corrupted_data(self):
367367 number_list = [2 ] * 22 ,
368368 name_list = [f"name_{ 2 } " ] * 7 ,
369369 )
370- index = AtlasVectorSearchIndex (
370+ index = VectorSearchIndex (
371371 name = "recent_article_idx" ,
372372 fields = ["headline" , "number" , "body" , "description_embedded" ],
373373 )
0 commit comments