Example #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')
Example #2
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)
Example #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)
Example #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
         )
Example #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,
         )
Example #6
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',
             python_shell=False,
             env=None
         )
Example #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"))
Example #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'))
Example #9
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")