def test_command_with_args(self): mock = MagicMock() with patch.dict(django.__salt__, {"cmd.run": mock}): django.command("settings.py", "runserver", None, None, "noinput", "somethingelse") mock.assert_called_once_with( "django-admin.py runserver --settings=settings.py " "--noinput --somethingelse" )
def test_django_admin_cli_command(self): mock = MagicMock() with patch.dict(djangomod.__salt__, {'cmd.run': mock}): djangomod.command('settings.py', 'runserver') mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py', python_shell=False, env=None)
def test_command_with_args(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command('settings.py', 'runserver', None, None, 'noinput', 'somethingelse') mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py ' '--noinput --somethingelse')
def test_command(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command('settings.py', 'runserver') mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py', env=None )
def test_command_with_kwargs_ignore_dunder(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command('settings.py', 'runserver', None, None, __ignore='something') mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py')
def test_django_admin_cli_command(self): mock = MagicMock() with patch.dict(djangomod.__salt__, {"cmd.run": mock}): djangomod.command("settings.py", "runserver") mock.assert_called_once_with( "django-admin.py runserver --settings=settings.py", python_shell=False, env=None, runas=None, )
def test_command_with_kwargs_ignore_dunder(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command( 'settings.py', 'runserver', None, None, __ignore='something' ) mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py', env=None )
def test_django_admin_cli_command_with_args(self): mock = MagicMock() with patch.dict(djangomod.__salt__, {'cmd.run': mock}): djangomod.command('settings.py', 'runserver', None, None, None, None, 'noinput', 'somethingelse') mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py ' '--noinput --somethingelse', python_shell=False, env=None, runas=None)
def test_command_with_kwargs(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command('settings.py', 'runserver', None, None, database='something') mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py ' '--database=something', env=None)
def test_django_admin_cli_command_with_kwargs_ignore_dunder(self): mock = MagicMock() with patch.dict(djangomod.__salt__, {'cmd.run': mock}): djangomod.command( 'settings.py', 'runserver', None, None, None, __ignore='something' ) mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py', python_shell=False, env=None, runas=None )
def test_command(self): """ Test if it runs arbitrary django management command """ mock = MagicMock(return_value=True) with patch.dict(djangomod.__salt__, {"cmd.run": mock}): self.assertTrue(djangomod.command("DJANGO_SETTINGS_MODULE", "validate"))
def test_command_with_kwargs(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command( 'settings.py', 'runserver', None, None, database='something' ) mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py ' '--database=something', python_shell=False, env=None )
def test_command(self): ''' Test if it runs arbitrary django management command ''' mock = MagicMock(return_value=True) with patch.dict(djangomod.__salt__, {'cmd.run': mock}): self.assertTrue(djangomod.command('DJANGO_SETTINGS_MODULE', 'validate'))
def test_command_with_args(self): mock = MagicMock() with patch.dict(django.__salt__, {'cmd.run': mock}): django.command( 'settings.py', 'runserver', None, None, None, 'noinput', 'somethingelse' ) mock.assert_called_once_with( 'django-admin.py runserver --settings=settings.py ' '--noinput --somethingelse', env=None )
def test_command_with_kwargs_ignore_dunder(self): mock = MagicMock() with patch.dict(django.__salt__, {"cmd.run": mock}): django.command("settings.py", "runserver", None, None, __ignore="something") mock.assert_called_once_with("django-admin.py runserver --settings=settings.py")
def test_command(self): mock = MagicMock() with patch.dict(django.__salt__, {"cmd.run": mock}): django.command("settings.py", "runserver") mock.assert_called_once_with("django-admin.py runserver --settings=settings.py")