Repository navigation
Revival/coverage and bugs - #26
Merged
Merged
Conversation
Explicit slug translations now survive unrelated field updates (gate was keying on "not the slug" instead of "is the slug's source field"); translations_link() uses pk not id; unsaved instances no longer leak cache values across each other; get_translation_obj() raises CanNotTranslate instead of a raw IntegrityError; list-typed translatable_fields can no longer be mutated in place. CI's coverage gate now fails on a clearly-named step instead of inside XML generation, make coverage no longer aborts before generating the HTML report, and HISTORY.md's cache-invalidation claim is corrected. 45/45 tests, 100% coverage, verified on Django 4.2/5.2/6.0. Signed-off-by: Angel Velasquez <me@angvp.com>
…tions Converts all 45 tests across 6 files to pytest functions with shared fixtures (book, library, cache cleanup), removing setUp/tearDown boilerplate duplicated across ~15 TestCase classes. Adopts idiomatic pytest patterns (pytest.raises, monkeypatch, django_assert_num_queries) in place of unittest assertion methods and mock.patch. Also ignores uv.lock: as a library tested across a Python/Django version matrix, a single locked resolution doesn't reflect how the package is actually consumed or CI-tested. Signed-off-by: Angel Velasquez <me@angvp.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #26 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 194 199 +5
=========================================
+ Hits 194 199 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CanNotTranslateinstead of rawIntegrityError, andtranslatable_fieldsas alistis no longer mutated in place.make coverageno longer aborts before generating the HTML report.unittest.TestCaseto pytest-native functions and fixtures, cutting ~15 duplicated setUp/tearDown blocks.uv.lock— this is a library tested across a Django/Python matrix, so a single locked resolution isn't representative.Test plan
pytest tests/ -v— 45/45 passingpytest tests/ --cov=klingon— 100% coverageruff check klingon tests— clean