Skip to content

Settings

These fixtures are related to Django project configuration.

Functions

settings

settings() -> SettingsProxy

Fixture allowing to temporarily override project settings.

def test_this(settings):
    # By one.
    settings.DEBUG = True

    # Batch.
    settings.update({
        'DEBUG': True,
        'ROOT_URLCONF': 'module.urls',
    })

    # Context manager.
    with settings(DEBUG=True):
        ...