summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_zcml.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-26 07:06:16 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-26 07:06:16 +0000
commit87f49ec51c262621682f43c90e8389da337fd0cf (patch)
tree76710573f57b383a1e7be187994681960271bdff /repoze/bfg/tests/test_zcml.py
parent4174e45860ac9a31c7fea619168c8865475993b4 (diff)
downloadpyramid-87f49ec51c262621682f43c90e8389da337fd0cf.tar.gz
pyramid-87f49ec51c262621682f43c90e8389da337fd0cf.tar.bz2
pyramid-87f49ec51c262621682f43c90e8389da337fd0cf.zip
- When two views were registered with the same ``accept`` argument,
but were otherwise registered with the same arguments, if a request entered the application which had an ``Accept`` header that accepted *either* of the media types defined by the set of views registered with predicates that otherwise matched, a more or less "random" one view would "win". Now, we try harder to use the view callable associated with the view configuration that has the most specific ``accept`` argument. Thanks to Alberto Valverde for an initial patch.
Diffstat (limited to 'repoze/bfg/tests/test_zcml.py')
-rw-r--r--repoze/bfg/tests/test_zcml.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/repoze/bfg/tests/test_zcml.py b/repoze/bfg/tests/test_zcml.py
index 2834a8cb1..2ad26bc97 100644
--- a/repoze/bfg/tests/test_zcml.py
+++ b/repoze/bfg/tests/test_zcml.py
@@ -854,7 +854,7 @@ class TestHandler(unittest.TestCase):
def test_it(self):
def foo():
- pass
+ """ """
from zope.interface import Interface
class IWhatever(Interface):
pass
@@ -881,30 +881,13 @@ class IFactory(Interface):
class DummyFactory(object):
implements(IFactory)
def __call__(self):
- return 1
+ """ """
class DummyModule:
__path__ = "foo"
__name__ = "dummy"
__file__ = ''
-class DummyModuleGrokker:
- def __init__(self, grokker=None):
- self.multi_grokker = grokker
-
-class DummyMartianModule:
- def grok_dotted_name(self, name, grokker, _info, _configurator,
- exclude_filter=None):
- self.name = name
- self.info = _info
- self.configurator = _configurator
- self.exclude_filter = exclude_filter
- return True
-
- def ModuleGrokker(self, grokker=None):
- self.module_grokker = DummyModuleGrokker(grokker)
- return self.module_grokker
-
class DummyContext:
def __init__(self, resolved=DummyModule):
self.actions = []