Running the Tests
==================

Since the tests need access to Ipernity, some preparation is necessary to run
them. You need an Ipernity account to run the tests. To prepare, follow this
procedure:

1. Create an Ipernity application on https://www.ipernity.com/apps/key
   Choose the "Web" authentication method and add something beginning with
   "http://127.0.0.1" as the callback URL.
2. Use your browser's developer tools to get your ipernity cookies.
3. Create a file tests/.test-config.yaml with the following contents:

    flask:
      SECRET_KEY: "<some random string>"
      IPERNITY_APP_KEY: "<your application key>"
      IPERNITY_APP_SECRET: "<your application secret>"

    ipernity:
      username: "<your display name on Ipernity>"
      cookies:
        www.ipernity.com:
          /:
            cookie_consent: ok
            s: "<your s cookie>"
            ua: "<your ua cookie>"

4. After that, you should be able to run the tests with

    pytest

