MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / setUp

Method setUp

test_haystack/test_forms.py:49–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47
48class ModelSearchFormTestCase(TestCase):
49 def setUp(self):
50 super().setUp()
51 # Stow.
52 self.old_unified_index = connections["default"]._index
53 self.ui = UnifiedIndex()
54 self.bmmsi = BasicMockModelSearchIndex()
55 self.bammsi = BasicAnotherMockModelSearchIndex()
56 self.ui.build(indexes=[self.bmmsi, self.bammsi])
57 connections["default"]._index = self.ui
58
59 # Update the "index".
60 backend = connections["default"].get_backend()
61 backend.clear()
62 backend.update(self.bmmsi, MockModel.objects.all())
63
64 self.sqs = SearchQuerySet()
65
66 def tearDown(self):
67 connections["default"]._index = self.old_unified_index

Callers

nothing calls this directly

Calls 10

UnifiedIndexClass · 0.90
SearchQuerySetClass · 0.90
buildMethod · 0.80
setUpMethod · 0.45
get_backendMethod · 0.45
clearMethod · 0.45
updateMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected