Skip to content

[test]: Created Record Set delete Unit Test - #8532

Open
gabek96 wants to merge 1 commit into
mainfrom
issue-8508
Open

gabek96 wants to merge 1 commit into
mainfrom
issue-8508

Conversation

@gabek96

@gabek96 gabek96 commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #8508

Created a test that deletes a record set that was created in a previous version

Summary by CodeRabbit

  • Tests
    • Expanded automated test coverage for deleting recordsets created in a previous version.
    • Added verification that deleting a recordset also removes its associated recordset items.
    • Confirmed related records are no longer present after deletion, improving confidence in data cleanup behavior.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

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: c316990b-48f8-4ac6-b563-66533c9b34ab

📥 Commits

Reviewing files that changed from the base of the PR and between 14cea30 and e26eb87.

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

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


📝 Walkthrough

Walkthrough

The test setup now creates a Recordset. A new test adds a Recordsetitem, deletes the Recordset, and verifies that both the recordset and its items are removed.

Changes

Recordset deletion validation

Layer / File(s) Summary
Recordset setup and deletion test
specifyweb/backend/businessrules/tests/test_delete_previously_created.py
The setup creates a Recordset. The test creates a linked Recordsetitem, checks the item count, deletes the recordset, and verifies that the recordset and its items no longer exist. A whitespace-only change is also included.

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to e26eb

The added test exercises the applicable recordset deletion behavior, with no remaining actionable risk identified.

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Testing Instructions ⚠️ Warning The PR description does not provide testing instructions. It only states that a test was created. The changed file adds a backend Django test for Recordset deletion and cascading removal of `Records… Add clear instructions such as: prepare the backend test environment with the required database and test dependencies, then run `./ve/bin/python manage.py test specifyweb.backend.businessrules.tests.test_delete_previously_created.TestDelete…
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #8508 requires a test for deleting a record set created in a previous version. The PR adds test_delete_recordset_created_in_previous_version in `specifyweb/backend/businessrules/tests/test_del…
Out of Scope Changes check ✅ Passed The reported change is limited to the test setup, the deletion test, and a whitespace-only edit in the same test file. These changes support or do not affect the objective in issue #8508. No unrelated…
Automatic Tests ✅ Passed The PR adds an automatic test in specifyweb/backend/businessrules/tests/test_delete_previously_created.py. The test_delete_recordset_created_in_previous_version method uses the repository test con…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies a unit test for deleting a record set. This matches the main change, which adds a test for deleting a record set created in a previous version.
Full details: Testing Instructions

Explanation

The PR description does not provide testing instructions. It only states that a test was created. The changed file adds a backend Django test for Recordset deletion and cascading removal of Recordsetitem rows linked to a Collectionobject. The repository template requires a Testing instructions section, and the CI workflow provides the Django test runner, but neither the targeted test command nor expected verification is documented.

Resolution

Add clear instructions such as: prepare the backend test environment with the required database and test dependencies, then run ./ve/bin/python manage.py test specifyweb.backend.businessrules.tests.test_delete_previously_created.TestDeletePreviousVersionObjects.test_delete_recordset_created_in_previous_version --verbosity=3. State that the test must confirm deletion of both the Recordset and its related Recordsetitem rows. Optionally run the full backend suite with ./ve/bin/python manage.py test --verbosity=3 --keepdb.

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

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.

@gabek96
gabek96 requested a review from rijulpoudel September 17, 2026 14:45
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]: Delete a record set that was created in a previous version

1 participant