Merge branch 'master' into develop

This commit is contained in:
Griatch 2021-01-30 13:13:00 +01:00
commit dc64e719b5
2 changed files with 9 additions and 3 deletions

View file

@ -184,7 +184,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
- at_server_reload()
- at_server_shutdown()
"""
"""
objects = AccountManager()
@ -680,6 +680,9 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
)
Character = class_from_module(character_typeclass)
if "location" not in kwargs:
kwargs["location"] = ObjectDB.objects.get_id(settings.START_LOCATION)
# Create the character
character, errs = Character.create(
character_key,

View file

@ -2,6 +2,7 @@
Unit tests for the utilities of the evennia.utils.gametime module.
"""
from datetime import datetime
import time
import unittest
from unittest.mock import Mock
@ -16,7 +17,7 @@ class TestGametime(TestCase):
def setUp(self) -> None:
self.time = time.time
self._SERVER_EPOCH = gametime._SERVER_EPOCH
time.time = Mock(return_value=1555595378.0)
time.time = Mock(return_value=datetime(2019, 4, 18, 13, 49, 38).timestamp())
gametime._SERVER_EPOCH = None
gametime.SERVER_RUNTIME = 600.0
gametime.SERVER_START_TIME = time.time() - 300
@ -54,7 +55,9 @@ class TestGametime(TestCase):
self.assertAlmostEqual(gametime.gametime(), 630.0 * 5)
def test_gametime_absolute(self):
self.assertAlmostEqual(gametime.gametime(absolute=True), 1555597898.0)
self.assertAlmostEqual(
gametime.gametime(absolute=True), datetime(2019, 4, 18, 14, 31, 38).timestamp()
)
def test_gametime_downtimes(self):
gametime.IGNORE_DOWNTIMES = True