mirror of
https://github.com/cassandra/home-information.git
synced 2026-04-17 21:19:45 -04:00
1.2 KiB
1.2 KiB
Testing
Unit Tests
./manage.py test
Integation Tests
TBD
Visual Testing Page
Visit: http://127.0.0.1:8411/tests/ui.
These tests/ui views are only available in the development environment when DEBUG=True. (They are conditionally loaded in the root urls.py.)
Adding to the Visual Testing Page
The hi.tests.ui module uses auto-discovery by looking in the app directories.
In the app directory you want to have a visual testing page:
mkdir -p tests/ui
touch tests.__init__.py
touch tests/ui.__init__.py
Then:
- Create
tests/ui/views.py - Create
tests/ui/urls.py(This gets auto-discovered. Esnure some default home page rule.)
The templates for these tests, by contention, would be put in the app's templates directory as templates/${APPNAME}/tests/ui.
Email Testing
There are some helper base classes to test viewing email formatting and sending emails.
hi.tests.ui.email_test_views.py
This requires the email templates follow the naming patterns expected in view classes.