Tuesday, July 13, 2021

Django Unit testing best practices

As long as your tests are sensibly arranged, they won’t become unmanageable. Good rules-of-thumb include having:

  • a separate TestClass for each model or view
  • a separate test method for each set of conditions you want to test
  • test method names that describe their function



Both UI and Model testing can be done with default jango test cases 



References:

https://docs.djangoproject.com/en/3.2/intro/tutorial05/

No comments:

Post a Comment