avoid erroneous multimatch

This commit is contained in:
Cal 2024-05-28 12:20:54 -06:00
parent 0fa3095359
commit f8de9a484e
2 changed files with 5 additions and 1 deletions

View file

@ -1352,7 +1352,7 @@ class ContribRPObject(DefaultObject):
results.extend(
[
obj
for obj in search_obj(searched_obj.key, candidates=candidates, **kwargs)
for obj in search_obj(searched_obj.key, candidates=[searched_obj], **kwargs)
if obj not in results
]
)

View file

@ -356,6 +356,10 @@ class TestRPSystem(BaseEvenniaTest):
result = self.speaker.get_search_result("something", candidates)
self.assertIn(self.obj1, result)
self.assertIn(self.obj2, result)
# search by sdesc with 2-disambiguator: only second object should be found
result = self.speaker.get_search_result("2-something", candidates)
self.assertNotIn(self.obj1, result)
self.assertIn(self.obj2, result)
# search empty candidates: no objects should be found
result = self.speaker.get_search_result("something", candidates=[])
self.assertNotIn(self.obj1, result)