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

Method setUp

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

Source from the content-addressed store, hash-verified

267 fixtures = ["base_data"]
268
269 def setUp(self):
270 super().setUp()
271
272 # Stow.
273 self.old_unified_index = connections["default"]._index
274 self.ui = UnifiedIndex()
275 self.bmmsi = BasicMockModelSearchIndex()
276 self.bammsi = BasicAnotherMockModelSearchIndex()
277 self.ui.build(indexes=[self.bmmsi, self.bammsi])
278 connections["default"]._index = self.ui
279
280 # Update the "index".
281 backend = connections["default"].get_backend()
282 backend.clear()
283 backend.update(self.bmmsi, MockModel.objects.all())
284
285 def tearDown(self):
286 connections["default"]._index = self.old_unified_index

Callers

nothing calls this directly

Calls 9

UnifiedIndexClass · 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