Fix unittests. Implement #1675.

This commit is contained in:
Griatch 2018-10-06 21:00:31 +02:00
parent 8b1ab0bc85
commit 550a25820d
2 changed files with 4 additions and 3 deletions

View file

@ -94,7 +94,7 @@ def homogenize_prototype(prototype, custom_keys=None):
homogenized["prototype_key"] = "prototype-{}".format(
hashlib.md5(str(time.time())).hexdigest()[:7])
if "typeclass" not in prototype:
if "typeclass" not in prototype and "prototype_parent" not in prototype:
homogenized["typeclass"] = settings.BASE_OBJECT_TYPECLASS
return homogenized

View file

@ -384,8 +384,9 @@ class TestPrototypeStorage(EvenniaTest):
prot3 = protlib.create_prototype(**self.prot3)
# partial match
self.assertEqual(list(protlib.search_prototype("prot")), [prot1b, prot2, prot3])
self.assertEqual(list(protlib.search_prototype(tags="foo1")), [prot1b, prot2, prot3])
with mock.patch("evennia.prototypes.prototypes._MODULE_PROTOTYPES", {}):
self.assertEqual(list(protlib.search_prototype("prot")), [prot1b, prot2, prot3])
self.assertEqual(list(protlib.search_prototype(tags="foo1")), [prot1b, prot2, prot3])
self.assertTrue(str(unicode(protlib.list_prototypes(self.char1))))