fix(diff_against): support diffing against deleted records#1312
fix(diff_against): support diffing against deleted records#1312euriostigue wants to merge 1 commit into
Conversation
af19ddf to
f98fec8
Compare
f98fec8 to
c39ef2a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1312 +/- ##
=======================================
Coverage 96.87% 96.87%
=======================================
Files 23 23
Lines 1282 1282
Branches 211 211
=======================================
Hits 1242 1242
Misses 21 21
Partials 19 19 ☔ View full report in Codecov by Sentry. |
|
@ddabble I noticed that you ran CI on this PR. Thank you! Do you mind reviewing this PR? Only the CI jobs running against Django's |
|
Sure, thank you for the PR! 😊 I'm not sure this is the best way of solving the issue, as how would a user know that the value I agree that Any thoughts on this? 🙂 (In any case, it's clear that the docs should be updated to explain what to expect when diffing a deleted object, at the very least :)) |
This modifies
diff_againstto compare against records whenhistory_typeis-.Description
When determining the record value for comparison, check if the
history_typecorresponds to a deletion. Use the valueNoneif the record corresponds to a deletion record.Related Issue
Closes #1307
Motivation and Context
In our application, we use
diff_againstto identify changes between records. A deletion was not detected as a change bydiff_against.How Has This Been Tested?
An added unit test checks comparisons in both directions:
Screenshots (if appropriate):
Types of changes
Checklist:
pre-commit runcommand to format and lint.AUTHORS.rstCHANGES.rst