conftest.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:django-gstorage 作者: fyndiq 项目源码 文件源码
def pytest_configure():
    from django.conf import settings

    settings.configure(
        DEBUG_PROPAGATE_EXCEPTIONS=True,
        DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3',
                               'NAME': ':memory:'}},
        SITE_ID=1,
        SECRET_KEY='not very secret in tests',
        USE_I18N=True,
        USE_L10N=True,
        INSTALLED_APPS=(
            'gstorage.apps.GStorageTestConfig',
        ),
    )

    try:
        import django
        django.setup()
    except AttributeError:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号