diff --git a/src/commands/default/tests.py b/src/commands/default/tests.py index 7e4c108b2..bf957f8a5 100644 --- a/src/commands/default/tests.py +++ b/src/commands/default/tests.py @@ -72,7 +72,7 @@ class CommandTest(TestCase): "sets up testing environment" self.player = create.create_player("TestPlayer%i" % self.CID, "test@test.com", "testpassword", typeclass=TestPlayerClass) self.player2 = create.create_player("TestPlayer%ib" % self.CID, "test@test.com", "testpassword", typeclass=TestPlayerClass) - self.room1 = create.create_object("src.objects.objects.Room", key="Room%i"%self.CID, testmode=True) + self.room1 = create.create_object("src.objects.objects.Room", key="Room%i"%self.CID, nohome=True) self.room1.db.desc = "room_desc" self.room2 = create.create_object("src.objects.objects.Room", key="Room%ib" % self.CID) self.obj1 = create.create_object(TestObjectClass, key="Obj%i" % self.CID, location=self.room1, home=self.room1) diff --git a/src/server/initial_setup.py b/src/server/initial_setup.py index 14aef6773..95399f510 100644 --- a/src/server/initial_setup.py +++ b/src/server/initial_setup.py @@ -60,11 +60,11 @@ def create_objects(): god_player.at_player_creation() god_player.locks.add("examine:perm(Immortals);edit:false();delete:false();boot:false();msg:all()") - # Create the in-game god-character for player #1. We can't set location and home yet since nothing - # exists. Also, all properties (name, email, password, is_superuser) - # is inherited from the user so we don't specify it again here. + # Limbo is the default "nowhere" starting room + + # Create the in-game god-character for player #1 and set it to exist in Limbo. character_typeclass = settings.BASE_CHARACTER_TYPECLASS - god_character = create.create_object(character_typeclass, key=god_player.username) + god_character = create.create_object(character_typeclass, key=god_player.username, nohome=True) god_character.id = 1 god_character.db.desc = _('This is User #1.') @@ -76,10 +76,8 @@ def create_objects(): god_player.attributes.add("_last_puppet", god_character) god_player.db._playable_characters.append(god_character) - # Limbo is the default "nowhere" starting room - room_typeclass = settings.BASE_ROOM_TYPECLASS - limbo_obj = create.create_object(room_typeclass, _('Limbo')) + limbo_obj = create.create_object(room_typeclass, _('Limbo'), nohome=True) limbo_obj.id = 2 string = " ".join([ "Welcome to your new {wEvennia{n-based game. From here you are ready to begin development.", diff --git a/src/utils/create.py b/src/utils/create.py index 5cd4c52c3..d726b8882 100644 --- a/src/utils/create.py +++ b/src/utils/create.py @@ -53,7 +53,7 @@ _GA = object.__getattribute__ def create_object(typeclass, key=None, location=None, home=None, permissions=None, locks=None, - aliases=None, destination=None, report_to=None, testmode=False): + aliases=None, destination=None, report_to=None, nohome=False): """ Create a new in-game object. Any game object is a combination of a database object that stores data persistently to @@ -69,7 +69,8 @@ def create_object(typeclass, key=None, location=None, If report_to is not set, errors will be raised as en Exception containing the error message. If set, this method will return None upon errors. - testmode is only intended for Evennia unittest system + nohome - this allows the creation of objects without a default home location; + this only used when creating default location itself or during unittests """ global _Object, _ObjectDB if not _Object: @@ -135,11 +136,8 @@ def create_object(typeclass, key=None, location=None, # perform a move_to in order to display eventual messages. if home: new_object.home = home - elif testmode: - # this is required by unittest - pass else: - new_object.home = settings.CHARACTER_DEFAULT_HOME + new_object.home = settings.CHARACTER_DEFAULT_HOME if not nohome else None if location: new_object.move_to(location, quiet=True)