How Important Is Writing Unit Tests For Django Applications?

54 views
Skip to first unread message

Daniel Coker

unread,
Mar 12, 2022, 1:03:33 PM3/12/22
to Django REST framework
I understand the importance of unit testing. However, if we are going to write integration tests (testing the views and viewset), this test will step through all of the modules that we would otherwise unit test.

So, I'm wondering, it it really necessary to write unit test for Django Applications when we will still test the views?

Artur Sonnenhohl

unread,
Mar 13, 2022, 2:04:38 PM3/13/22
to Django REST framework
I understand what you mean, but imagine one example where you have a specific function that calculates a price, with the unit tests you have the possibility to test multiple scenarios and variables for this price calculation, with the integration tests you can do that as well but it will be more difficult since you have a lot of others things to consider as well, so both types of tests are important.
Reply all
Reply to author
Forward
0 new messages