From 570243fcf3f9bb7b3da78404b0598011791ac882 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 23 Dec 2019 13:57:14 -0600 Subject: add coverage tests for deprecation warnings --- tests/test_config/test_routes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/test_config/test_routes.py') diff --git a/tests/test_config/test_routes.py b/tests/test_config/test_routes.py index 4ff67cf66..423da5834 100644 --- a/tests/test_config/test_routes.py +++ b/tests/test_config/test_routes.py @@ -1,4 +1,5 @@ import unittest +import warnings from . import dummyfactory from . import DummyContext @@ -308,6 +309,16 @@ class RoutesConfiguratorMixinTests(unittest.TestCase): else: # pragma: no cover raise AssertionError + def test_add_route_effective_principals_deprecated(self): + config = self._makeOne(autocommit=True) + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter('always', DeprecationWarning) + config.add_route('foo', '/bar', effective_principals=['any']) + self.assertIn( + 'removed the concept of principals', str(w[-1].message) + ) + class DummyRequest: subpath = () -- cgit v1.2.3