[Django]-How to mock django settings attributes in pytest-django

6👍

You can pass in settings as a test fixture, then modify it how you need. Here’s an example from the documentation:

def test_with_specific_settings(settings):
    settings.USE_TZ = True
    assert settings.USE_TZ

Leave a comment