Django & HTMX App - Custom Managers | pytest & factory-boy for unit tests

preview_player
Показать описание
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:

In this video, we'll add a custom model manager to our app's transaction model, and will set up pytest and factory-boy for unit testing our application functionality.

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:55 Creating custom Django QuerySet methods
05:40 Override default model manager in Django model
10:05 Setting up pytest
11:45 Creating factory-boy Factory classes for Django models
18:11 Testing out Factory classes
19:51 Creating pytest fixture to inject transactions
21:22 Writing pytest functions for custom QuerySet methods

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:

#python #django #webdevelopment #htmx
Рекомендации по теме
Комментарии
Автор

Gorgeous series. So nice you combine coding, testing and ui. Thanks a lot!

alexdubkov
Автор

Awesome Series. Totally lost myself in it. You got my sub!

Yahyazini
Автор

Thanks, a very useful.I have realized I haven't been following the DRY principal in Django.

repotranstech
Автор

5:00 You can use Coalesce to handle None values.

MikeJones-feye
Автор

Does it leave the test data in the db every time you run the tests?

christolabuschagne