โ๏ธ ๐๐๐ ๐บ๐ฒ ๐ฎ ๐ฐ๐ผ๐ณ๐ณ๐ฒ๐ฒ:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
โญTop resource to learn Python - https://datacamp.pxf.io/kOjKkV โญ
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.
Github: https://github.com/bugbytes-io/Django-HTMX-Finance-App
๐ ๐๐ต๐ฎ๐ฝ๐๐ฒ๐ฟ๐:
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
๐ฆ๐ผ๐ฐ๐ถ๐ฎ๐น ๐ ๐ฒ๐ฑ๐ถ๐ฎ:
๐ Blog: https://bugbytes.io/posts/
๐พ Github: https://github.com/bugbytes-io/Django-HTMX-Finance-App
๐ฆ Twitter: https://twitter.com/bugbytesio
๐ ๐๐๐ฟ๐๐ต๐ฒ๐ฟ ๐ฟ๐ฒ๐ฎ๐ฑ๐ถ๐ป๐ด ๐ฎ๐ป๐ฑ ๐ถ๐ป๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐ถ๐ผ๐ป:
Django Managers: https://docs.djangoproject.com/en/5.0/topics/db/managers/
Pytest: https://docs.pytest.org/en/8.2.x/
pytest-django: https://pytest-django.readthedocs.io/en/latest/
factory-boy: https://factoryboy.readthedocs.io/en/stable/
#python #django #webdevelopment #htmx