test: migrate backend suites to pytest with module coverage gate
Split backend tests into unit and integration suites, add isolated fixtures and coverage enforcement, and update CI and test documentation. Cover current authentication, content, notification, payment, media, and admin flows; fix behaviors revealed by the new tests. Validate both suites and the per-module gate against local PostgreSQL.
This commit is contained in:
15
apps/blog/tests/unit/test_seed_helpers.py
Normal file
15
apps/blog/tests/unit/test_seed_helpers.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import pytest
|
||||
|
||||
from apps.blog.management.commands.seed_blog_categories import console_safe as category_console_safe
|
||||
from apps.blog.management.commands.seed_blog_mock_data import make_image_bytes, make_markdown
|
||||
from apps.blog.management.commands.seed_blog_tags import console_safe as tag_console_safe
|
||||
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
||||
def test_seed_helpers_produce_readable_markdown_and_image():
|
||||
assert "# Workshop" in make_markdown("Workshop")
|
||||
assert make_image_bytes("Banner", 120, 80, (20, 30, 40)).startswith(b"\xff\xd8")
|
||||
assert category_console_safe("دسته") == "دسته"
|
||||
assert tag_console_safe("برچسب") == "برچسب"
|
||||
Reference in New Issue
Block a user