I'm writing tests for a Django app that fetches and parses JSON data from an API. I want to test the parsing by giving the method a known, sample JSON file. Two questions:
- Where would it be best to put this? It's not quite a fixture, so I'm not sure if putting it in my app's
fixtures/
directory will be confusing. - I know I can load the file using
open()
but how should I specify the correct filepath in a way that will be robust?