DjangoCon US 2023

Mastering Test Driven Development in Django: A Comprehensive Guide with factory_boy and faker
2023-10-15 , Tutorial Track B

Test Driven Development (TDD) has become a widely used methodology in software development to ensure code quality and minimize bugs. In this workshop, you will learn the fundamentals of TDD and its benefits, along with practical tools like factory_boy and faker for pre-populating data factories in tests. You will also learn how to write tests for Django REST endpoints, mock 3rd party services, and parameterize tests for different user types and roles. By the end of this workshop, you will have a solid understanding of TDD and the skills to implement it in your Django projects. Whether you are a beginner or an experienced developer, this workshop will provide valuable insights and techniques for mastering TDD in Django.


In this workshop, we will learn the followings:

  1. What is Test Driven Development (TDD)?
  2. The benefits of TDD
  3. Introduction to factory_boy.
  4. Using faker to pre-populate the data factories in the tests.
  5. Writing Tests for the Django REST Endpoints
  6. Mocking the 3rd party services in the tests
  7. Parameterizing the tests

After the workshop, you can understand and follow the TDD approach in your Django Project.

You can pre-populate the Django factory models with factory_boy and faker. In the Django project, you can write tests for different user types/roles and tests for very simple to very complex test cases.

As someone passionate about technology, I have had the privilege of speaking at several international tech conferences, including APIDays India 2022, APISecure 2022, and DjangoCon US 2022. I was honored to have my proposal selected for DjangoCon US 2022, where I could share my insights with a global audience.

While I am grateful for my recognition, I know there is always more to learn and new perspectives to consider. Therefore, I approach each speaking opportunity as a chance to continue my learning and growth, as well as a chance to share my insights with others.

As a speaker, I aim to provide attendees with new ideas, fresh perspectives, and actionable insights. I strive to make my presentations engaging, educational, and thought-provoking, and I am always eager to hear feedback and incorporate new ideas.

I understand that I don't know everything, and I am humbled by the opportunity to learn from others. Being involved in the tech community is an ongoing journey, and I am eager to continue learning and growing however I can.