Implemented a unit testing framework for Evennia. Unfortunately it seems it is only usable in latest Django SVN, due to a Django bug; Run "manage.py test-evennia" - if you get errors about SUPPORTS_TRANSACTIONS, you are affected by the bug. Since this is only likely to affect evennia devs at this point I added a few base tests in src/objects/tests.py as a template for those willing to help add unit tests.

This commit is contained in:
Griatch 2010-11-21 19:02:24 +00:00
parent a7899e0119
commit 502ebff1a2
7 changed files with 227 additions and 15 deletions

View file

@ -538,7 +538,7 @@ def has_perm(accessing_obj, accessed_obj, lock_type, default_deny=False):
if typelist and lock_type in typelist]
if not locklist or not any(locklist):
# No locks; use default security policy
# No viable locks; use default security policy
return not default_deny
# we have locks of the right type. Set default flag OR on all that
@ -562,8 +562,7 @@ def has_perm(accessing_obj, accessed_obj, lock_type, default_deny=False):
# try to add permissions from connected player
if hasattr(accessing_obj, 'has_player') and accessing_obj.has_player:
# accessing_obj has a valid, connected player. We start with
# those permissions.
# accessing_obj has a valid, connected player. We start with those permissions.
player = accessing_obj.player
if player.is_superuser:
# superuser always has access