def setUp(self):
self.css = '<link rel="stylesheet" href="/static/css/one.css" type="text/css" />'
self.tmpdir = mkdtemp()
new_static_root = os.path.join(self.tmpdir, "static")
copytree(settings.STATIC_ROOT, new_static_root)
self.override_settings = self.settings(
COMPRESS_ENABLED=True,
COMPRESS_PRECOMPILERS=(),
COMPRESS_DEBUG_TOGGLE='nocompress',
DEBUG=True,
STATIC_ROOT=new_static_root,
COMPRESS_ROOT=new_static_root,
STATICFILES_DIRS=[settings.COMPRESS_ROOT]
)
self.override_settings.__enter__()
test_base.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录