Repository navigation
Add regression test for UUID values (#24) - #172
Open
GiannopoulosK wants to merge 1 commit into
Open
GiannopoulosK wants to merge 1 commit into
GiannopoulosK wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Closes #24.
Summary
The
ValueError: Cannot convert UUID(...) to Excelreported in #24 no longer occurs. It was fixed indirectly by #34 (released in 0.4.1), which runs cell values throughstr()as part of value sanitization. Before that change, rawuuid.UUIDobjects were passed straight to openpyxl, which can't write them.I confirmed the export works on the latest release (2.6.0).
Changes
Since nothing in the code handles UUIDs explicitly, this adds a regression test (
test_uuid_values) so the bug can't silently return if the sanitization logic changes. It covers:UUIDField(DRF already serializes this to a string)ReadOnlyFieldpassing a rawuuid.UUIDthroughSerializerMethodFieldreturning a rawuuid.UUIDThe test first asserts that the last two really do produce
uuid.UUIDobjects, then checks that all three cells contain the UUID as a string.