Fix issues caused by HttpRequest API change in Python 3
Review Request #10922 — Created Feb. 26, 2020 and submitted
Python 3's urllib changed the request object so that instead of having a
get_data
method, there's now just adata
attribute. It turns out
that this attribute also existed in Python 2, although it wasn't the
official API. This change modifies the idonethis tests to use that
everywhere.
Ran rbintegrations unit tests.
Description | From | Last Updated |
---|---|---|
get_data() has been useless forever. It's literally just defined as return self.data, and we use .data pretty much everywhere else. … |
chipx86 | |
json.loads() expects a Unicode string, but request.data should be bytes. Looks like this would apply to others. Can you verify … |
chipx86 | |
Wanna change this to assertIsNone? |
chipx86 | |
And here? |
chipx86 |
- Description:
-
Python 3's urllib changed the request object so that instead of having a
~ get_data
method, there's now just adata
attribute. The unit tests~ for the idonethis integration used this API a lot, so this needed to be ~ updated to run properly on both Python 2 and 3. ~ get_data
method, there's now just adata
attribute. It turns out~ that this attribute also existed in Python 2, although it wasn't the ~ official API. This change modifies the idonethis tests to use that + everywhere. - Commit:
-
42f03081b4813d78a7b5e9756815168b6f79523cc85fdcad8e5dea27e78a501abca6e6594a5d103c
- Diff:
-
Revision 2 (+43 -37)
Checks run (2 succeeded)
- Change Summary:
-
Use
assertIsNone
everywhere that it can be. - Commit:
-
c85fdcad8e5dea27e78a501abca6e6594a5d103c79c65a298882306e3374aa85badb0ab95e2182df
- Diff:
-
Revision 3 (+49 -43)