MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / setUp

Method setUp

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

Source from the content-addressed store, hash-verified

33 fixtures = ["base_data"]
34
35 def setUp(self):
36 super().setUp()
37
38 # Stow.
39 self.old_unified_index = connections["default"]._index
40 self.ui = UnifiedIndex()
41 self.bmmsi = BasicMockModelSearchIndex()
42 self.bammsi = BasicAnotherMockModelSearchIndex()
43 self.ui.build(indexes=[self.bmmsi, self.bammsi])
44 connections["default"]._index = self.ui
45
46 # Update the "index".
47 backend = connections["default"].get_backend()
48 backend.clear()
49 backend.update(self.bmmsi, MockModel.objects.all())
50
51 def tearDown(self):
52 connections["default"]._index = self.old_unified_index

Callers 3

setUpMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45

Calls 8

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

Tested by

no test coverage detected