Skip to content

[test]: Added tests for gifts - #8493

Open
rijulpoudel wants to merge 4 commits into
mainfrom
issue-8492
Open

[test]: Added tests for gifts#8493
rijulpoudel wants to merge 4 commits into
mainfrom
issue-8492

Conversation

@rijulpoudel

@rijulpoudel rijulpoudel commented Sep 2, 2026

Copy link
Copy Markdown
Member

Fixes #8492

Summary by CodeRabbit

  • Tests
    • Expanded coverage for creating gifts with gift numbers, dates, and disciplines.
    • Added coverage for creating and linking new agents to gifts with roles and disciplines.
    • Verified that gift and agent relationship details are preserved when retrieved.
    • Added coverage for shipments containing complete delivery, packaging, insurance, weight, and descriptive details.
    • Verified that shipment information is preserved when retrieved.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 1aacf846-5874-49ec-9524-cff380a2e47b

📥 Commits

Reviewing files that changed from the base of the PR and between c326649 and c367750.

📒 Files selected for processing (1)
  • specifyweb/backend/businessrules/tests/test_gift.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds tests for gift fields, agent relationships, and shipment field persistence after database retrieval.

Changes

Gift test coverage

Layer / File(s) Summary
Gift and agent relationship tests
specifyweb/backend/businessrules/tests/test_gift.py
Adds tests for gift number, gift date, discipline, and Giftagent relationships. Covers both existing agents and newly created agents.
Gift shipment persistence test
specifyweb/backend/businessrules/tests/test_gift.py
Adds a test that creates a fully populated Shipment through a gift and verifies all fields after retrieval.

Merge Risk: ⚪ Minimal · up to c3677

This adds gift, agent relationship, and shipment persistence coverage without changing production behavior. No merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Testing Instructions ⚠️ Warning The PR description contains only Fixes #8492`` and no testing instructions. The repository PR template requires a ### Testing instructions section. The changed test file affects Gift, Giftagent/Agen… Add a ### Testing instructions section. State the focused command, for example ./ve/bin/python manage.py test specifyweb.backend.businessrules.tests.test_gift --verbosity=3, and identify the expected coverage: Gift-to-Agent/Giftagent li…
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding tests for gifts.
Linked Issues check ✅ Passed The pull request adds gift tests for creating an agent and adding a shipment, which matches issue #8492.
Out of Scope Changes check ✅ Passed The changes are limited to gift-related tests and align with the linked issue.
Automatic Tests ✅ Passed The PR adds automatic tests in specifyweb/backend/businessrules/tests/test_gift.py. GiftTests extends ApiTests, which extends Django TestCase. The added test_create_new_agent_for_gift and `t…
Full details: Testing Instructions

Explanation

The PR description contains only Fixes #8492`` and no testing instructions. The repository PR template requires a ### Testing instructions section. The changed test file affects Gift, Giftagent/Agent, and Gift-to-Shipment behavior through `test_create_new_agent_for_gift` and `test_add_shipment_with_all_fields_to_gift`, but the PR does not state how to run or verify these tests.

Resolution

Add a ### Testing instructions section. State the focused command, for example ./ve/bin/python manage.py test specifyweb.backend.businessrules.tests.test_gift --verbosity=3, and identify the expected coverage: Gift-to-Agent/Giftagent linkage and Gift-to-Shipment field round-tripping. Also state whether the full backend command ./ve/bin/python manage.py test --verbosity=3 --keepdb was run.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-8492

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

[test]: Add tests for Gifts

1 participant