当前位置: 首页>>代码示例>>Python>>正文


Python Command.set_options方法代码示例

本文整理汇总了Python中django.contrib.staticfiles.management.commands.collectstatic.Command.set_options方法的典型用法代码示例。如果您正苦于以下问题:Python Command.set_options方法的具体用法?Python Command.set_options怎么用?Python Command.set_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.contrib.staticfiles.management.commands.collectstatic.Command的用法示例。


在下文中一共展示了Command.set_options方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_post_processing

# 需要导入模块: from django.contrib.staticfiles.management.commands.collectstatic import Command [as 别名]
# 或者: from django.contrib.staticfiles.management.commands.collectstatic.Command import set_options [as 别名]
    def test_post_processing(self):
        """Test that post_processing behaves correctly.

        Files that are alterable should always be post-processed; files that
        aren't should be skipped.

        collectstatic has already been called once in setUp() for this testcase,
        therefore we check by verifying behavior on a second run.
        """
        collectstatic_args = {
            'interactive': False,
            'verbosity': '0',
            'link': False,
            'clear': False,
            'dry_run': False,
            'post_process': True,
            'use_default_ignore_patterns': True,
            'ignore_patterns': ['*.ignoreme'],
        }

        collectstatic_cmd = CollectstaticCommand()
        collectstatic_cmd.set_options(**collectstatic_args)
        stats = collectstatic_cmd.collect()
        self.assertIn(os.path.join('cached', 'css', 'window.css'), stats['post_processed'])
        self.assertIn(os.path.join('cached', 'css', 'img', 'window.png'), stats['unmodified'])
        self.assertIn(os.path.join('test', 'nonascii.css'), stats['post_processed'])
开发者ID:Absherr,项目名称:django,代码行数:28,代码来源:tests.py

示例2: test_post_processing

# 需要导入模块: from django.contrib.staticfiles.management.commands.collectstatic import Command [as 别名]
# 或者: from django.contrib.staticfiles.management.commands.collectstatic.Command import set_options [as 别名]
    def test_post_processing(self):
        """
        Test that post_processing behaves correctly.

        Files that are alterable should always be post-processed; files that
        aren't should be skipped.

        collectstatic has already been called once in setUp() for this testcase,
        therefore we check by verifying behavior on a second run.
        """
        collectstatic_args = {
            "interactive": False,
            "verbosity": 0,
            "link": False,
            "clear": False,
            "dry_run": False,
            "post_process": True,
            "use_default_ignore_patterns": True,
            "ignore_patterns": ["*.ignoreme"],
        }

        collectstatic_cmd = CollectstaticCommand()
        collectstatic_cmd.set_options(**collectstatic_args)
        stats = collectstatic_cmd.collect()
        self.assertIn(os.path.join("cached", "css", "window.css"), stats["post_processed"])
        self.assertIn(os.path.join("cached", "css", "img", "window.png"), stats["unmodified"])
        self.assertIn(os.path.join("test", "nonascii.css"), stats["post_processed"])
开发者ID:codeclimate-testing,项目名称:django,代码行数:29,代码来源:test_storage.py

示例3: collect

# 需要导入模块: from django.contrib.staticfiles.management.commands.collectstatic import Command [as 别名]
# 或者: from django.contrib.staticfiles.management.commands.collectstatic.Command import set_options [as 别名]
 def collect(self):
     collectstatic_cmd = CollectstaticCommand()
     collectstatic_cmd.set_options(**COLLECTSTATIC_ARGS)
     return collectstatic_cmd.collect()
开发者ID:funkybob,项目名称:django-mangle,代码行数:6,代码来源:__init__.py


注:本文中的django.contrib.staticfiles.management.commands.collectstatic.Command.set_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。