(self)
| 188 | call_command("shell", interface="bpython") |
| 189 | |
| 190 | def test_python(self): |
| 191 | cmd = shell.Command() |
| 192 | mock_code = mock.Mock(interact=mock.MagicMock()) |
| 193 | options = {"verbosity": 0, "no_startup": True, "no_imports": False} |
| 194 | |
| 195 | with mock.patch.dict(sys.modules, {"code": mock_code}): |
| 196 | cmd.python(options) |
| 197 | |
| 198 | self.assertEqual( |
| 199 | mock_code.interact.mock_calls, |
| 200 | [mock.call(local=cmd.get_namespace(**options))], |
| 201 | ) |
| 202 | |
| 203 | # [1] Patch select to prevent tests failing when the test suite is run |
| 204 | # in parallel mode. The tests are run in a subprocess and the subprocess's |
nothing calls this directly
no test coverage detected