New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LB-393: Upgrade flask to 1.0.2 #453
Merged
Merged
Conversation
This file contains 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
The response here includes debug tools data, including text such as: <small>CPU: 144.13ms (159.74ms)</small> This means that the two responses will never be identical. By comparing only the first 100 characters, we compare enough to know whether the case sensitivity worked, and we also ignore all of the debugging info.
alastair
reviewed
Nov 5, 2018
Related to LB-393. Refactored test_username_case to be more efficient. We cannot use the assertContext function here, as it doesn't let us read its child properties. By using get_context_variable, we can get the "user" object, and then read its musicbrainz_id attribute.
paramsingh
approved these changes
Nov 6, 2018
Refactor test case for username cases, so that the entire User object is compared, instead of just the musicbrainz_id attribute.
Added a second test case for testing usernames, and also refactored test case to avoid issues with SQLAlchemy's ResultProxy.
Change the user data type from a dict to an object in user tests, so that (i) it is more readable, and (b) we can query with assertContext for the test_username_case test case. We use db_user.get_or_create instead of just create() so that the user is only created if it doesn't already exist, but we don't store the output since it's returned as a dict.
alastair
reviewed
Nov 6, 2018
Removed two lines that weren't needed.
alastair
approved these changes
Nov 6, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! Thanks for working through all the changes, I think we've left this code in a better state than it was before 🎉
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
Updating Flask to 1.0.4.
Problem
The previous version of Flask was outdated, so this updates the BrainzUtils package (and therefore Flask).
Solution
The response in one of the test cases includes debug tools data, including text such as:
This means that the two responses will never be identical.
By comparing only the first 100 characters, we compare enough to know whether the case sensitivity worked, and we also ignore all of the debugging info.