Open
Conversation
e9359fe to
b3ab812
Compare
Codecov Report
@@ Coverage Diff @@
## master #840 +/- ##
=======================================
Coverage 98.33% 98.34%
=======================================
Files 231 231
Lines 2590 2594 +4
=======================================
+ Hits 2547 2551 +4
Misses 43 43
Continue to review full report at Codecov.
|
Gallaecio
reviewed
Nov 23, 2020
Comment on lines
+142
to
+146
| if ( | ||
| not settings.RETURN_AS_TIMEZONE_AWARE | ||
| or (settings.RETURN_AS_TIMEZONE_AWARE | ||
| and 'default' == settings.RETURN_AS_TIMEZONE_AWARE and not is_originally_aware) | ||
| ): |
Member
There was a problem hiding this comment.
💄
Suggested change
| if ( | |
| not settings.RETURN_AS_TIMEZONE_AWARE | |
| or (settings.RETURN_AS_TIMEZONE_AWARE | |
| and 'default' == settings.RETURN_AS_TIMEZONE_AWARE and not is_originally_aware) | |
| ): | |
| if ( | |
| not settings.RETURN_AS_TIMEZONE_AWARE | |
| or ( | |
| not is_originally_aware | |
| and settings.RETURN_AS_TIMEZONE_AWARE == 'default' | |
| ) | |
| ): |
| logging.config.dictConfig(config) | ||
|
|
||
|
|
||
| def is_aware(date_obj): |
| self.then_date_was_parsed() | ||
| self.then_parsed_period_is('day') | ||
| self.then_parsed_date_is(expected_result) | ||
|
|
Member
There was a problem hiding this comment.
Are these tests complete enough?
Given the changes I would expect a test where the date contains a timezone, settings specify a different timezone, and we check that the parsed timezone is the one from the input string, and not the one from the settings.
Also a test about the change to if settings.RETURN_AS_TIMEZONE_AWARE is not True:.
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.
Fix
ValueErrorwhen parsing a date string that already contains timezone info with thecustom-formatsparser.fixes: #376, closes: #375