From ab4e7b9befb1b84deedfcb29766e8250113ba566 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 3 Dec 2009 23:06:20 +0000 Subject: - ``repoze.bfg.testing.DummyModel`` now accepts a new constructor keyword argument: ``__provides__``. If this constructor argument is provided, it should be an interface or a tuple of interfaces. The resulting model will then provide these interfaces (they will be attached to the constructed model via ``zope.interface.alsoProvides``). --- repoze/bfg/tests/test_testing.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'repoze/bfg/tests/test_testing.py') diff --git a/repoze/bfg/tests/test_testing.py b/repoze/bfg/tests/test_testing.py index 7c8b7ad30..72ecd96b0 100644 --- a/repoze/bfg/tests/test_testing.py +++ b/repoze/bfg/tests/test_testing.py @@ -402,6 +402,10 @@ class TestDummyModel(unittest.TestCase): model = self._makeOne() self.assertEqual(model.__nonzero__(), True) + def test_ctor_with__provides__(self): + model = self._makeOne(__provides__=IDummy) + self.failUnless(IDummy.providedBy(model)) + class TestDummyRequest(unittest.TestCase): def _getTargetClass(self): from repoze.bfg.testing import DummyRequest -- cgit v1.2.3