I am writing a unit test that needs to access an image file that I put in \"fixtures\" directory right under my django app directory. I want to open up this image file in my tes
Python3.4 and above comes with standard library pathlib.
pathlib
from pathlib import Path import appmodule pth = Path(appmodule.__file__).parent / 'fixtures' if pth.exists(): "Your code here"
parent will give you the path of your app directory, and / will append fixtures as path.
parent
/