(self)
| 148 | registry._set_default_serializer.assert_called_with('auth') |
| 149 | |
| 150 | def test_security_conf(self): |
| 151 | self.app.conf.task_serializer = 'auth' |
| 152 | with pytest.raises(ImproperlyConfigured): |
| 153 | self.app.setup_security() |
| 154 | |
| 155 | self.app.conf.accept_content = ['auth'] |
| 156 | with pytest.raises(ImproperlyConfigured): |
| 157 | self.app.setup_security() |
| 158 | |
| 159 | _import = builtins.__import__ |
| 160 | |
| 161 | def import_hook(name, *args, **kwargs): |
| 162 | if name == 'cryptography': |
| 163 | raise ImportError |
| 164 | return _import(name, *args, **kwargs) |
| 165 | |
| 166 | builtins.__import__ = import_hook |
| 167 | with pytest.raises(ImproperlyConfigured): |
| 168 | self.app.setup_security() |
| 169 | builtins.__import__ = _import |
| 170 | |
| 171 | def test_reraise_errors(self): |
| 172 | with pytest.raises(SecurityError): |
nothing calls this directly
no test coverage detected