unit-testing #19

Merged
calm-steam merged 5 commits from calm-steam/GameServerSupervisor:unit-testing into master 2025-02-18 19:07:38 +01:00
Member

each feature branch should work on the unit tests of the files it touches.
I recommend writing the test of the functionality before implementing the feature (TDD).
tests for existing functionality should be written retroactively.

tests in django follow this scheme: https://docs.djangoproject.com/en/5.1/topics/testing/overview/

to note:

  • differentiating tests by test labels
  • test database handling

I recommend to organize unit tests by:
src/module/class
src/module/test_class

mirroring the project structure can lead to problems when restructuring the project.
keeping them in a separate directory makes it inconvenient to develop.

to consider:

  • avoid test database creation (use of mock)

HOW TO TEST

./manage.py test

each feature branch should work on the unit tests of the files it touches. \ I recommend writing the test of the functionality before implementing the feature (TDD). \ tests for existing functionality should be written retroactively. tests in django follow this scheme: https://docs.djangoproject.com/en/5.1/topics/testing/overview/ to note: - differentiating tests by test labels - test database handling I recommend to organize unit tests by: \ src/module/class \ src/module/test_class mirroring the project structure can lead to problems when restructuring the project. \ keeping them in a separate directory makes it inconvenient to develop. to consider: - avoid test database creation (use of [mock](https://medium.com/@sabya.nandy14/quick-unit-testing-of-django-models-with-mock-3fb0d966726c)) HOW TO TEST `./manage.py test`
calm-steam added 5 commits 2025-02-16 11:42:30 +01:00
pratyush approved these changes 2025-02-18 16:39:49 +01:00
calm-steam merged commit 8251fecf9a into master 2025-02-18 19:07:38 +01:00
Sign in to join this conversation.
No description provided.