Installation¶
Required Software¶
Git
Python
Firefox web browser
Geckodriver
MySQL (preferably with MySQL workbench)
Local Setup¶
Clone the repository
Create the following environment variables:
SECRET_KEY
DATABASE
DB_USER
DB_PASSWORD
DJANGO_EMAIL_HOST_USER
- a gmail accountDJANGO_EMAIL_HOST_PASSWORD
- password to the gmail account (prefarably an app password)
Create and activate a virtual environment using
pipenv
by running$ pipenv shell
Install dev dependencies by running
$ pipenv install --dev
Run the tests using
$ python manage.py test --settings=resource_center.settings.test
.Make sure you have
geckodriver
installed and in yourPATH
before attempting to run the test. Read selenium python docs for more information on how to do this.You could also add this flag
--exclude-tag=functional
to run unit tests only.
Notes¶
Environment variables can be stored in a
.env
file in the repository root.Pipenv
automatically sets the variables defined in.env
as environment variables when the virtual environment is activated.