Towards Parametrizing Fixtures and Test Functions

preview_player
Показать описание
Pytest is a popular python test automation framework. Here we look at Parametrizing Fixtures and Test Functions with Pytest in a Django project.
A useful feature of Pytest, parametrization allows us to define multiple sets of arguments and fixtures at the test function or class. Although pytest enables test parametrization at several levels, in this tutorial we get started by working through an example of a test function that implements parametrization checking multiple input leads to the expected output.

Code Repository

🐱‍🏍Would you like to SUPPORT US FURTHER so that we can make even more great content - Please consider joining our members community.

👍SUBSCRIBE to get more free tutorials, courses and code snippets!
Рекомендации по теме
Комментарии
Автор

Hmmm weird but for some reason my category attribute refuses to accept 1 as it's value it says: "Cannot assign 1: Product.category must be a Category instance" I know it wants an actual Category object but how do I do create and/or use the Category object inside the parameterize decorator?

arvinmaltezobareng
Автор

can serializers also be tested in the way you showed how to test forms ?

mueezkhan
Автор

can we get a link to the e-commerce project example codebase? thank you for your awesomness!

internetbro