Skip to content

Improve Instagram App Test Coverage#348

Merged
animemoeus merged 6 commits intomasterfrom
copilot/improve-pytest-coverage-instagram
Mar 4, 2026
Merged

Improve Instagram App Test Coverage#348
animemoeus merged 6 commits intomasterfrom
copilot/improve-pytest-coverage-instagram

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Description

This pull request adds comprehensive unit tests for the admin actions, models, serializers, and signal handlers in the Instagram app. The new tests focus on verifying custom admin actions, model behaviors, serializer validation and creation logic, and signal-triggered background tasks, improving the reliability and coverage of critical features.

Admin actions testing:

  • Adds tests for custom admin actions in InstagramUserAdmin, verifying correct behavior and error handling for updating user profiles and queuing story/post updates via API. (instagram/tests/admin/test_user_admin.py)

Model logic testing:

  • Adds tests for StoryCredit and StoryCreditPayment models, including string representations, credit accumulation, and ensuring credits are created and updated correctly when payments are made. (instagram/tests/models/test_credit.py)

Serializer validation and creation:

  • Adds tests for user creation and history serializers, covering username validation, profile picture logic, and story credit validation, including edge cases for negative and zero values. (instagram/tests/serializers/test_serializers.py)

Signal handler testing:

  • Adds tests for Django signal handlers for user, story, post, and post media models, verifying that background tasks are correctly queued or skipped based on model field values and ensuring media downloads and post-processing are triggered as expected. (instagram/tests/signals/test_signals.py)

Copilot AI and others added 2 commits March 4, 2026 04:01
Co-authored-by: animemoeus <33395829+animemoeus@users.noreply.github.com>
…e review fixes

Co-authored-by: animemoeus <33395829+animemoeus@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve pytest coverage for Instagram app Improve instagram app test coverage (77% → 98%) Mar 4, 2026
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI and others added 2 commits March 4, 2026 04:29
Co-authored-by: animemoeus <33395829+animemoeus@users.noreply.github.com>
Co-authored-by: animemoeus <33395829+animemoeus@users.noreply.github.com>
Copilot AI changed the title Improve instagram app test coverage (77% → 98%) Fix ruff linter errors in instagram/tests Mar 4, 2026
@animemoeus animemoeus marked this pull request as ready for review March 4, 2026 04:44
@animemoeus animemoeus changed the title Fix ruff linter errors in instagram/tests Improve Instagram App Test Coverage Mar 4, 2026
@animemoeus animemoeus merged commit f62111e into master Mar 4, 2026
3 checks passed
@animemoeus animemoeus deleted the copilot/improve-pytest-coverage-instagram branch March 4, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants