Settings

These fixtures are related to Django project configuration.

pytest_djangoapp.fixtures.settings.settings() → pytest_djangoapp.fixtures.settings.SettingsProxy

Fixture allowing to temporarily override project settings.

Example:

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

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

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