From c0aaa274e2ae978e5a4a9d335771554b518fe615 Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 3 Jun 2019 18:28:11 +0200 Subject: [PATCH] [fix] Fix unit tests --- evennia/contrib/tests.py | 2 -- evennia/objects/manager.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/evennia/contrib/tests.py b/evennia/contrib/tests.py index c576de29fd..3293cab4e1 100644 --- a/evennia/contrib/tests.py +++ b/evennia/contrib/tests.py @@ -510,7 +510,6 @@ class TestChargen(CommandTest): # Testing clothing contrib from evennia.contrib import clothing -from evennia.objects.objects import DefaultRoom class TestClothingCmd(CommandTest): @@ -985,7 +984,6 @@ class TestTutorialWorldRooms(CommandTest): # test turnbattle from evennia.contrib.turnbattle import tb_basic, tb_equip, tb_range, tb_items, tb_magic -from evennia.objects.objects import DefaultRoom class TestTurnBattleBasicCmd(CommandTest): diff --git a/evennia/objects/manager.py b/evennia/objects/manager.py index 4562e0ffb5..1b39d33e5a 100644 --- a/evennia/objects/manager.py +++ b/evennia/objects/manager.py @@ -270,7 +270,7 @@ class ObjectDBManager(TypedObjectManager): db_tags__db_tagtype__iexact="alias"))).order_by('id').distinct() elif candidates: # fuzzy with candidates - search_candidates = self.filter(cand_restriction & type_restriction).order_by('id') + search_candidates = self.filter(cand_restriction & type_restriction).distinct().order_by('id') else: # fuzzy without supplied candidates - we select our own candidates search_candidates = self.filter(type_restriction & (Q(db_key__istartswith=ostring) | @@ -281,7 +281,7 @@ class ObjectDBManager(TypedObjectManager): index_matches = string_partial_matching(key_strings, ostring, ret_index=True) if index_matches: # a match by key - return list({obj for ind, obj in enumerate(search_candidates) if ind in index_matches}) + return [obj for ind, obj in enumerate(search_candidates) if ind in index_matches] else: # match by alias rather than by key search_candidates = search_candidates.filter(db_tags__db_tagtype__iexact="alias",