added duplicate clause in move.py#1098
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1098 +/- ##
=======================================
Coverage 92.78% 92.78%
=======================================
Files 74 74
Lines 4311 4311
=======================================
Hits 4000 4000
Misses 311 311 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
audiodude
left a comment
There was a problem hiding this comment.
This looks good, and existing tests pass. Honestly though, this should come with a "failing test", aka a test that demonstrates the issue and is failing at HEAD, but works in the PR. Up to you.
|
Hi @audiodude, added a failing test as requested. The test inserts an initial move record, verifies it was inserted correctly, then inserts a second move with the same primary key but different destination fields. It then checks whether the record was updated with the new values from move2 rather than raising an IntegrityError. Let me know if any changes are required :) |
audiodude
left a comment
There was a problem hiding this comment.
THanks for the test, definitely the right idea!
Unfortunately you have accidentally made more work for yourself, but the end result wil be much stronger.
c5664fb to
22e5bde
Compare
|
Failing Black format, please fix. |
|
My bad, added black formatting now |
Added an ON DUPLICATE KEY UPDATE clause to move.py which updates m_new_namespace and m_new_article
as discussed in #101