From 87f49ec51c262621682f43c90e8389da337fd0cf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 26 Nov 2009 07:06:16 +0000 Subject: - 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. --- repoze/bfg/tests/test_zcml.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'repoze/bfg/tests/test_zcml.py') 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 = [] -- cgit v1.2.3