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

Method setUp

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

Source from the content-addressed store, hash-verified

13
14class SearchFormTestCase(TestCase):
15 def setUp(self):
16 super().setUp()
17
18 # Stow.
19 self.old_unified_index = connections["default"]._index
20 self.ui = UnifiedIndex()
21 self.bmmsi = BasicMockModelSearchIndex()
22 self.bammsi = BasicAnotherMockModelSearchIndex()
23 self.ui.build(indexes=[self.bmmsi, self.bammsi])
24 connections["default"]._index = self.ui
25
26 # Update the "index".
27 backend = connections["default"].get_backend()
28 backend.clear()
29 backend.update(self.bmmsi, MockModel.objects.all())
30
31 self.sqs = SearchQuerySet()
32
33 def tearDown(self):
34 connections["default"]._index = self.old_unified_index

Callers 2

setUpMethod · 0.45
setUpMethod · 0.45

Calls 9

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

Tested by

no test coverage detected