[Fixed]-Which test methodology is best for testing the whole Django REST application?

1👍

To fully cover a large application on all levels you’ll want three kinds of tests. From lowest to highest level you’ll want

  • Unit Tests: Tests to make sure that each individual class, or even better, method does what you expect at a logic level. Here you call your methods and assert that expected conditions are true. I have not used PyVows but it seems that PyVows would be a useful tool for unit testing. Django Unit Testing framework is also very sufficient for this.
  • Integration Tests: Larger tests that ensure the different classes or apps within the entire django project work together as expected.
  • Functional Tests: Tests that simulate user actions and ensure that these actions are handled correctly, call the correct methods, and display/process the correct information based on user interaction. A tool like Selenium Webdriver is useful for functional testing.

To learn how to write well-tested django applications I highly recommend reading the book Test-Driven Development with Python, by Dan O’Reilly. It is a free read online and gives a great introduction to writing highly testable applications, stressing the benefits of TDD.

👤rfj001

Leave a comment