mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Add model_mummy for mocking model data
This commit is contained in:
parent
b3dc85a4dc
commit
37151e6b89
3 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ future >= 0.15.2
|
|||
django-sekizai
|
||||
inflect
|
||||
autobahn >= 17.9.3
|
||||
model_mommy
|
||||
|
||||
# testing
|
||||
mock >= 1.0.1
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ future >= 0.15.2
|
|||
django-sekizai
|
||||
autobahn >= 17.9.3
|
||||
inflect
|
||||
model_mommy
|
||||
|
||||
# testing
|
||||
mock >= 1.0.1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue