Compare HTTP responses against byte strings.

Review Request #10479 — Created March 31, 2019 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

HttpResponse.content is a byte string, and we have a lot of tests
comparing these against Unicode strings. In Python 2, that's not a big
deal, but Python 3 heavily distinguishes between the two.

This change updates all comparisons to check only against byte strings.

Unit tests pass on Python 2.7 and 3.5-3.7 (with other in-progress
changes).

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Compare HTTP responses against byte strings.
`HttpResponse.content` is a byte string, and we have a lot of tests comparing these against Unicode strings. In Python 2, that's not a big deal, but Python 3 heavily distinguishes between the two. This change updates all comparisons to check only against byte strings.
0e1193e96a64066cd5d694666fe5640e845dd4e9 Christian Hammond
reviewboard/accounts/tests/test_check_login_required_view_mixin.py
reviewboard/accounts/tests/test_login_required_view_mixin.py
reviewboard/accounts/tests/test_user_profile_required_view_mixin.py
reviewboard/diffviewer/tests/test_diff_renderer.py
reviewboard/reviews/tests/test_reviews_diff_fragment_view.py
reviewboard/search/tests.py
reviewboard/site/tests.py
reviewboard/webapi/tests/test_draft_patched_file.py
reviewboard/webapi/tests/test_original_file.py
reviewboard/webapi/tests/test_patched_file.py
Loading...