Open Kanaderu opened 4 years ago
Unittests are executed by running ./manage.py test
Finished with user unittests for now I think. The only thing on the user unittests may be to check that the sliding tokens work like they're supposed to but haven't verified that entirely during development.
Testing websockets will need to be done differently than from traditional Django Testcase setups. This will probably be addressed in Django v3.0 due to the added support for async operations.
Current setup for testing async operations for now are from the following documentation links: https://channels.readthedocs.io/en/latest/topics/testing.html
https://pytest-django.readthedocs.io/en/latest/tutorial.html https://pytest-django.readthedocs.io/en/latest/configuring_django.html
Running pytests to test the async operations is done by running pytest
Leaving a note that ignoring the deprecation warnings using
@pytest.mark.filterwarnings('ignore::DeprecationWarning')
was added since pytest didn't like the regular expressions for the DRF routes accounting for case-insensitive endpoints for Feather
and LoRaGateway
. Hopefully, there will be a patch to fix this in a later release of DRF.
May need to pylint
the backend too
Add unittests for websocket channels
Add backend unittests. As more features are added, it becomes much more difficult to verify existing features work.
Backend tests should be testable and managed with
manage.py
for now. Applying CI at this stage is maybe too early.