(self)
| 230 | @mock.patch("__main__.__spec__", None) |
| 231 | @mock.patch("sys.warnoptions", []) |
| 232 | def test_exe_fallback(self): |
| 233 | with tempfile.TemporaryDirectory() as tmpdir: |
| 234 | exe_path = Path(tmpdir) / "django-admin.exe" |
| 235 | exe_path.touch() |
| 236 | with mock.patch("sys.argv", [exe_path.with_suffix(""), "runserver"]): |
| 237 | self.assertEqual( |
| 238 | autoreload.get_child_arguments(), [exe_path, "runserver"] |
| 239 | ) |
| 240 | |
| 241 | @mock.patch("sys.warnoptions", []) |
| 242 | @mock.patch.dict(sys.modules, {"__main__": django.__main__}) |