def test_more_like_this(self): mock = MockModel() mock.id = 1 msq = MockSearchQuery() msq.backend = MockSearchBackend("mlt") ui = connections["default"].get_unified_index() bmmsi = BasicMockModelSearchIndex() ui.build(indexes=[bmmsi]) bmmsi.update() msq.more_like_this(mock) self.assertEqual(msq.get_count(), 23) self.assertEqual(int(msq.get_results()[0].pk), MOCK_SEARCH_RESULTS[0].pk)
def test_more_like_this(self): mock = MockModel() mock.id = 1 self.assertEqual(len(self.msqs.more_like_this(mock)), 23)
def test_more_like_this(self): mock = MockModel() mock.id = 1 self.assertEqual(len(self.search_index.objects.more_like_this(mock)), 23)