Skip to content
Discussion options

You must be logged in to vote

A couple more remarks:

def auto_use_fake_fs(db, fs_session) works for this example indeed. as long as auto_use_fake_fs remains function scoped (because db is function scoped).

Actually, I wrote that wrong, it should have been:

def auto_use_fake_fs(django_db_setup, fs_session):
    yield

e.g. make sure the session-scoped db fixture is used before the session-scoped fs fixture.

fs_session.add_real_directory(Path(django.file).parent) also works in the example I provided, but not in the real test suite.

In the example, the memory-based SQLite-db is used, which django uses per default for the tests. If you use your real database (something like postgreSQL) in your test instead, this would …

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by konnerthg
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1264 on January 08, 2026 19:05.