def test_django_admin_cli_migrate(self): mock = MagicMock() with patch.dict(djangomod.__salt__, {"cmd.run": mock}): djangomod.migrate("settings.py") mock.assert_called_once_with( "django-admin.py migrate --settings=settings.py --noinput", python_shell=False, env=None, runas=None, )
def test_migrate(self): """ Test if it runs the Django-Admin migrate command """ mock = MagicMock(return_value=True) with patch.dict(djangomod.__salt__, {"cmd.run": mock}): self.assertTrue(djangomod.migrate("DJANGO_SETTINGS_MODULE"))
def test_migrate(self): ''' Test if it runs the Django-Admin migrate command ''' mock = MagicMock(return_value=True) with patch.dict(djangomod.__salt__, {'cmd.run': mock}): self.assertTrue(djangomod.migrate('DJANGO_SETTINGS_MODULE'))