Пример #1
0
 def test_collectstatic(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {'cmd.run': mock}):
         django.collectstatic('settings.py', None, True, 'something', True,
                              True, True, True)
         mock.assert_called_once_with(
             'django-admin.py collectstatic --settings=settings.py '
             '--noinput --no-post-process --dry-run --clear --link '
             '--no-default-ignore --ignore=something')
Пример #2
0
 def test_collectstatic(self):
     mock = MagicMock()
     with patch.dict(django.__salt__, {"cmd.run": mock}):
         django.collectstatic("settings.py", None, True, "something", True, True, True, True)
         mock.assert_called_once_with(
             "django-admin.py collectstatic --settings=settings.py "
             "--noinput --no-post-process --dry-run --clear --link "
             "--no-default-ignore --ignore=something"
         )
Пример #3
0
 def test_collectstatic(self):
     mock = MagicMock()
     with patch.dict(django.__salt__,
                     {'cmd.run': mock}):
         django.collectstatic(
             'settings.py', None, True, 'something', True, True, True, True
         )
         mock.assert_called_once_with(
             'django-admin.py collectstatic --settings=settings.py '
             '--noinput --no-post-process --dry-run --clear --link '
             '--no-default-ignore --ignore=something', env=None
         )
Пример #4
0
 def test_django_admin_cli_collectstatic(self):
     mock = MagicMock()
     with patch.dict(djangomod.__salt__, {"cmd.run": mock}):
         djangomod.collectstatic("settings.py", None, True, "something",
                                 True, True, True, True)
         mock.assert_called_once_with(
             "django-admin.py collectstatic --settings=settings.py "
             "--noinput --no-post-process --dry-run --clear --link "
             "--no-default-ignore --ignore=something",
             python_shell=False,
             env=None,
             runas=None,
         )
Пример #5
0
 def test_collectstatic(self):
     """
     Test if it collect static files from each of your applications
     into a single location
     """
     mock = MagicMock(return_value=True)
     with patch.dict(djangomod.__salt__, {"cmd.run": mock}):
         self.assertTrue(djangomod.collectstatic("DJANGO_SETTINGS_MODULE"))