Commits

Thomas Wanschik  committed 95a234c

adapted tests to new API

  • Participants
  • Parent commits f37c617

Comments (0)

Files changed (1)

File search/tests.py

 from django.conf import settings
 settings.SEARCH_BACKEND = 'search.backends.immediate_update'
 
+from search import register
 from search.core import SearchManager, startswith
 
 
     check = models.BooleanField()
     value = models.CharField(max_length=500)
 
-    # search managers
-    one_index = SearchManager('one', indexer=startswith)
-    one_two_index = SearchManager(('one', 'two'))
-    # relation index manager
-    value_index = SearchManager('value', integrate=('one', 'check'))
+register(Indexed, 'one_index', 'one', indexer=startswith)
+register(Indexed, 'one_two_index', ('one', 'two'))
+register(Indexed, 'value_index', 'value', integrate=('one', 'check'))
 
 # Test filters
 class FiltersIndexed(models.Model):
     value = models.CharField(max_length=500)
     check = models.BooleanField()
 
-    checked_index = SearchManager(('value', ), filters={'check':True, })
+register(FiltersIndexed, 'checked_index', 'value', filters={'check':True, })
 
 class TestIndexed(TestCase):
     def setUp(self):