示例#1
0
 def test_syncdb_migrate(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {'cmd.run': mock}):
         django.syncdb('settings.py', migrate=True)
         mock.assert_called_once_with(
             'django-admin.py syncdb --settings=settings.py --migrate '
             '--noinput')
示例#2
0
文件: django.py 项目: yeyuexia/salt
 def test_syncdb(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {'cmd.run': mock}):
         django.syncdb('settings.py')
         mock.assert_called_once_with(
             'django-admin.py syncdb --settings=settings.py --noinput',
             env=None)
示例#3
0
 def test_django_admin_cli_syncdb(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__, {'cmd.run': mock}):
         djangomod.syncdb('settings.py')
         mock.assert_called_once_with(
             'django-admin.py syncdb --settings=settings.py --noinput',
             python_shell=False,
             env=None)
示例#4
0
 def test_syncdb(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.syncdb('settings.py')
         mock.assert_called_once_with(
             'django-admin.py syncdb --settings=settings.py --noinput',
             env=None
         )
示例#5
0
 def test_django_admin_cli_syncdb(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__, {"cmd.run": mock}):
         djangomod.syncdb("settings.py")
         mock.assert_called_once_with(
             "django-admin.py syncdb --settings=settings.py --noinput",
             python_shell=False,
             env=None,
             runas=None,
         )
示例#6
0
文件: django.py 项目: DaveQB/salt
 def test_syncdb_migrate(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.syncdb('settings.py', migrate=True)
         mock.assert_called_once_with(
             'django-admin.py syncdb --settings=settings.py --migrate '
             '--noinput',
             python_shell=False,
             env=None
         )
示例#7
0
 def test_syncdb(self):
     """
     Test if it runs the Django-Admin syncdb command
     """
     mock = MagicMock(return_value=True)
     with patch.dict(djangomod.__salt__, {"cmd.run": mock}):
         self.assertTrue(djangomod.syncdb("DJANGO_SETTINGS_MODULE"))
示例#8
0
 def test_syncdb(self):
     '''
     Test if it runs the Django-Admin syncdb command
     '''
     mock = MagicMock(return_value=True)
     with patch.dict(djangomod.__salt__, {'cmd.run': mock}):
         self.assertTrue(djangomod.syncdb('DJANGO_SETTINGS_MODULE'))
示例#9
0
文件: django.py 项目: Barrybaby/salt
 def test_syncdb_migrate(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {"cmd.run": mock}):
         django.syncdb("settings.py", migrate=True)
         mock.assert_called_once_with("django-admin.py syncdb --settings=settings.py --migrate " "--noinput")