diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-12-03 23:06:20 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-12-03 23:06:20 +0000 |
| commit | ab4e7b9befb1b84deedfcb29766e8250113ba566 (patch) | |
| tree | 669204dd5f167ee57fcc20fbf08621a559d161f3 /repoze/bfg/tests/test_testing.py | |
| parent | 49ce9b5339756a9c4f195e4987f3c233ee77a9f8 (diff) | |
| download | pyramid-ab4e7b9befb1b84deedfcb29766e8250113ba566.tar.gz pyramid-ab4e7b9befb1b84deedfcb29766e8250113ba566.tar.bz2 pyramid-ab4e7b9befb1b84deedfcb29766e8250113ba566.zip | |
- ``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``).
Diffstat (limited to 'repoze/bfg/tests/test_testing.py')
| -rw-r--r-- | repoze/bfg/tests/test_testing.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |
