Skip to content

[test] add existing accession to collection object - #8578

Open
HeetJani123 wants to merge 1 commit into
mainfrom
issue-8570
Open

HeetJani123 wants to merge 1 commit into
mainfrom
issue-8570

Conversation

@HeetJani123

@HeetJani123 HeetJani123 commented Sep 23, 2026 •

Copy link
Copy Markdown

Fixes #8570

Summary by CodeRabbit

  • Tests
    • Added coverage confirming that a collection object linked to an existing accession retains the correct accession and accession number. This change strengthens verification of accession associations; it does not introduce a user-facing feature or change application behavior.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1ae401b1-f42b-4ebd-be7c-890af24ca2b9

📥 Commits

Reviewing files that changed from the base of the PR and between 3a8ddb1 and 5b157dc.

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

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Adds a unit test for a collection object linked to an existing accession. The test checks that the fetched object references the created accession and has the expected accession number.

Changes

Collection Object Accession

Layer / File(s) Summary
Test accession linkage
specifyweb/backend/businessrules/tests/test_collectionobject.py
Adds a test that creates an accession and a linked collection object. The test checks the fetched object’s accession reference and accession number.

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to 5b157

The new test checks that an existing accession remains linked after the collection object is reloaded. No issue requiring a change before merge was established.

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Testing Instructions ⚠️ Warning The PR description contains only “Fixes #8570” and provides no testing instructions. The changed component is specifyweb/backend/businessrules/tests/test_collectionobject.py, which adds `test_add_ex… Add clear instructions to the PR description. For example: ./venv/bin/python -m pytest specifyweb/backend/businessrules/tests/test_collectionobject.py -v. State that the targeted CollectionObjectTests tests must pass, including `test_ad…
✅ 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 and concisely describes the added test for adding an existing accession to a collection object.
Linked Issues check ✅ Passed Issue #8570 requires unit tests for Collection Object behavior. The PR adds test_add_existing_accession_to_collectionobject in specifyweb/backend/businessrules/tests/test_collectionobject.py. The …
Out of Scope Changes check ✅ Passed The changes are limited to the issue objective in #8570. The added Accession import supports the new Collection Object unit test. No unrelated production behavior or unrelated test changes are prese…
Automatic Tests ✅ Passed The pull request adds an automatic test method, test_add_existing_accession_to_collectionobject, to the discovered CollectionObjectTests test class. The test creates an Accession, assigns it to …
Full details: Testing Instructions

Explanation

The PR description contains only “Fixes #8570” and provides no testing instructions. The changed component is specifyweb/backend/businessrules/tests/test_collectionobject.py, which adds test_add_existing_accession_to_collectionobject for the Collectionobject.accession relationship. The repository template requires a Testing instructions section, but the PR does not state how to run or verify this affected test.

Resolution

Add clear instructions to the PR description. For example: ./venv/bin/python -m pytest specifyweb/backend/businessrules/tests/test_collectionobject.py -v. State that the targeted CollectionObjectTests tests must pass, including test_add_existing_accession_to_collectionobject, and describe that the test verifies an existing Accession remains linked after creating and fetching a Collectionobject.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@HeetJani123 HeetJani123 added this to the 7.12.2 milestone Sep 25, 2026
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]: Create Collection Object unit tests

1 participant