Use 'in' rather than 'has_key'.
| | |
| | | |
| | | def get_cookies(environ): |
| | | header = environ.get('HTTP_COOKIE', '') |
| | | if environ.has_key('paste.cookies'): |
| | | if 'paste-cookies' in environ: |
| | | cookies, check_header = environ['paste.cookies'] |
| | | if check_header == header: |
| | | return cookies |
| | |
| | | self.assertEqual(dummy_factory.closed, True) |
| | | self.assertEqual(identity['md'], [ [1,2,3] ]) |
| | | self.assertEqual(dummy_factory.query, 'select foo from bar') |
| | | self.failIf(identity.has_key('__userid')) |
| | | self.failIf('__userid' in identity) |
| | | |
| | | class TestMakeSQLAuthenticatorPlugin(unittest.TestCase): |
| | | |
| | |
| | | self.assertEqual(headers[3], |
| | | ('a', '1')) |
| | | self.assertEqual(start_response.exc_info, None) |
| | | self.failIf(environ.has_key('repoze.who.application')) |
| | | self.failIf('repoze.who.application' in environ) |
| | | |
| | | def test_call_app_doesnt_call_start_response(self): |
| | | from webob.exc import HTTPUnauthorized |