Writing Tests in Django
In Chapter 8, we learned about Celery and how we can write Celery tasks to solve our problem of long-running tasks. Celery helps us to implement periodic tasks using Celery Beat. So, with all the knowledge we have gained so far, we can create applications that solve business use cases. One thing we should always remember is that writing code is easy, especially when doing so from scratch, but the hard part comes when we have to maintain the code and add new features/improve features in the existing code base. This is where one of the most important concepts of programming enters the picture – testing.
In this chapter, we shall learn the different aspects of testing and why testing is important, learning how to write maintainable test cases that don’t make your system brittle but give you the flexibility and confidence to ship new features fast.
Here are the topics we’ll be covering in this chapter:
- Introducing the different...