Add model_mummy for mocking model data

This commit is contained in:
Griatch 2019-03-12 19:15:22 +01:00
parent b3dc85a4dc
commit 37151e6b89
3 changed files with 6 additions and 2 deletions

View file

@ -4,6 +4,7 @@ Test AMP client
"""
import pickle
from model_mommy import mommy
from unittest import TestCase
from mock import MagicMock, patch
from twisted.trial.unittest import TestCase as TwistedTestCase
@ -18,12 +19,13 @@ from evennia.utils import create
from twisted.internet.base import DelayedCall
DelayedCall.debug = True
@patch("evennia.server.initial_setup.get_god_account",
MagicMock(return_value=create.account("TestAMPAccount", "test@test.com", "testpassword")))
# @patch("evennia.server.initial_setup.get_god_account",
# MagicMock(return_value=create.account("TestAMPAccount", "test@test.com", "testpassword")))
class _TestAMP(TwistedTestCase):
def setUp(self):
super(_TestAMP, self).setUp()
self.account = mommy.make("accounts.AccountDB", id=1)
self.server = server.Evennia(MagicMock())
self.server.sessions.data_in = MagicMock()
self.server.sessions.data_out = MagicMock()

View file

@ -9,6 +9,7 @@ future >= 0.15.2
django-sekizai
inflect
autobahn >= 17.9.3
model_mommy
# testing
mock >= 1.0.1

View file

@ -12,6 +12,7 @@ future >= 0.15.2
django-sekizai
autobahn >= 17.9.3
inflect
model_mommy
# testing
mock >= 1.0.1