1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #28501 -- Fixed "python -m django runserver" crash.

This commit is contained in:
Yusuke Miyazaki
2017-10-25 16:29:05 +09:00
committed by Tim Graham
parent ac21f2e391
commit 278d66b94b
2 changed files with 17 additions and 1 deletions

View File

@@ -277,3 +277,12 @@ class RestartWithReloaderTests(SimpleTestCase):
autoreload.restart_with_reloader()
self.assertEqual(mock_call.call_count, 1)
self.assertEqual(mock_call.call_args[0][0], [self.executable, '-Wall'] + argv)
def test_python_m_django(self):
main = '/usr/lib/pythonX.Y/site-packages/django/__main__.py'
argv = [main, 'runserver']
mock_call = self.patch_autoreload(argv)
with mock.patch('django.__main__.__file__', main):
autoreload.restart_with_reloader()
self.assertEqual(mock_call.call_count, 1)
self.assertEqual(mock_call.call_args[0][0], [self.executable, '-Wall', '-m', 'django'] + argv[1:])