Writing tests is essential to guarantee the efficiency and consistency of our code.
Testing can be done to check individual units of code (unit testing) or to check the relation between our modules (integration testing). We will use django's TestCase class, and Django REST framework APIClient class to create tests for our models and API endpoints.
Writing tests is essential to guarantee the efficiency and consistency of our code. Testing can be done to check individual units of code (unit testing) or to check the relation between our modules (integration testing). We will use django's
TestCase
class, and Django REST frameworkAPIClient
class to create tests for our models and API endpoints.Models unit tests:
Clients
Referrals
Endpoints integration tests:
UpdateUserView
GetReferralsView
GetUserReferralsView
GetReferralView
CreateReferralView
AcceptReferralView