hackoregon / cookiecutter-hacko-backend

Cookiecutter template for quickstarting a Hack Oregon Backend API
MIT License
2 stars 0 forks source link

[Enhancement] Add Testing Support for Project Repos #8

Open BrianHGrant opened 5 years ago

BrianHGrant commented 5 years ago

Is your feature request related to a problem? Please describe.

A project created from this template should have a base model of acceptance tests to guide developers in setting up useful tests.

In the past this is something which we have not provided a systematic solution for, this causes downstream issues when non-functioning code is pushed to production.

Describe the solution you'd like

Provide the basic files which would need to setup developers to write tests to accompany code including any needed template values.

I am proposing a using tox: https://tox.readthedocs.io/en/latest/

to manage testing on different python versions/django/drf versions as defined in our support combined with py.test: https://docs.pytest.org/en/latest/

Which provides a straightfoward test environment.

Some hack oregon projects have used pytest in the past:

We would also need to figure out how to connect with a testing database solution. Past projects have connected to production databases, with read-only creds, but projects this year will be needing POST/write-creds

Describe alternatives you've considered

There are a few different testing solutions available for django and python apps:

https://docs.python-guide.org/writing/tests/ - lists most widely used current ones.

The combination of tox + py.test seemed to provide best option to test for python compatibility and setup a sucessful test suite

Explain how this feature relates to your Hack Oregon project scope. Add any other context or screenshots about the feature request here.