(self)
| 145 | self.assertEqual(stdout.getvalue().strip(), __version__) |
| 146 | |
| 147 | def test_ipython(self): |
| 148 | cmd = shell.Command() |
| 149 | mock_ipython = mock.Mock(start_ipython=mock.MagicMock()) |
| 150 | options = {"verbosity": 0, "no_imports": False} |
| 151 | |
| 152 | with mock.patch.dict(sys.modules, {"IPython": mock_ipython}): |
| 153 | cmd.ipython(options) |
| 154 | |
| 155 | self.assertEqual( |
| 156 | mock_ipython.start_ipython.mock_calls, |
| 157 | [mock.call(argv=[], user_ns=cmd.get_namespace(**options))], |
| 158 | ) |
| 159 | |
| 160 | @mock.patch("django.core.management.commands.shell.select.select") # [1] |
| 161 | @mock.patch.dict("sys.modules", {"IPython": None}) |
nothing calls this directly
no test coverage detected