[fix] Fix unit tests
This commit is contained in:
parent
08b0f3fbf8
commit
94918c8b72
2 changed files with 2 additions and 4 deletions
|
|
@ -510,7 +510,6 @@ class TestChargen(CommandTest):
|
||||||
|
|
||||||
# Testing clothing contrib
|
# Testing clothing contrib
|
||||||
from evennia.contrib import clothing
|
from evennia.contrib import clothing
|
||||||
from evennia.objects.objects import DefaultRoom
|
|
||||||
|
|
||||||
|
|
||||||
class TestClothingCmd(CommandTest):
|
class TestClothingCmd(CommandTest):
|
||||||
|
|
@ -985,7 +984,6 @@ class TestTutorialWorldRooms(CommandTest):
|
||||||
|
|
||||||
# test turnbattle
|
# test turnbattle
|
||||||
from evennia.contrib.turnbattle import tb_basic, tb_equip, tb_range, tb_items, tb_magic
|
from evennia.contrib.turnbattle import tb_basic, tb_equip, tb_range, tb_items, tb_magic
|
||||||
from evennia.objects.objects import DefaultRoom
|
|
||||||
|
|
||||||
|
|
||||||
class TestTurnBattleBasicCmd(CommandTest):
|
class TestTurnBattleBasicCmd(CommandTest):
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ class ObjectDBManager(TypedObjectManager):
|
||||||
db_tags__db_tagtype__iexact="alias"))).order_by('id').distinct()
|
db_tags__db_tagtype__iexact="alias"))).order_by('id').distinct()
|
||||||
elif candidates:
|
elif candidates:
|
||||||
# fuzzy with 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:
|
else:
|
||||||
# fuzzy without supplied candidates - we select our own candidates
|
# fuzzy without supplied candidates - we select our own candidates
|
||||||
search_candidates = self.filter(type_restriction & (Q(db_key__istartswith=ostring) |
|
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)
|
index_matches = string_partial_matching(key_strings, ostring, ret_index=True)
|
||||||
if index_matches:
|
if index_matches:
|
||||||
# a match by key
|
# 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:
|
else:
|
||||||
# match by alias rather than by key
|
# match by alias rather than by key
|
||||||
search_candidates = search_candidates.filter(db_tags__db_tagtype__iexact="alias",
|
search_candidates = search_candidates.filter(db_tags__db_tagtype__iexact="alias",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue