lundi 24 juillet 2017

How to have Django test files in a "tests" folder?

The structure of my project is as follows:

  • project_name
    • api

Now, when I had all of my tests*.py files in the 'api' folder then everything ran fine. Specifically, this worked fine:

response = self.client.post('/graphql/?query=...')

But when I tried to create a folder called "tests" and place all of my tests in it, then the aforementioned line of code didn't work. I know it's some kind of relative referencing issue but I don't know how to fix it.

Any suggestions?

Robert

Aucun commentaire:

Enregistrer un commentaire