Archive

Posts Tagged ‘faker’

Improve your tests in Django with fakes and factories

August 12, 2019 Leave a comment

Introduction
In our Django apps, we have the M(odel)T(emplate)V(iew) structure (mostly known as MVC). When we want to test its functionality we usually have to create some model instances and work with them and the database.

A nice and easy approach for doing so is to create fake data in our tests in the form of factories and fakers.

In the following article, we are going to look at some practical examples and techniques. This will improve the readability and behavior of your tests.

https://hacksoft.blog/improve-your-tests-django-fakes-and-factories/

Source:
https://www.pythonweekly.com/

Advertisements
Categories: python Tags: ,