• 
      

    Fix a bug where HttpTestContext.assertHTTPCall doesn't verify the URL.

    Review Request #14308 — Created Jan. 24, 2025 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.x

    Reviewers

    Our hosting service unit tests use HttpTestContext.assertHTTPCall to
    test whether the right HTTP call was made during tests. The method is
    supposed to verify that the given URL is used in the request. However, we
    actually had a bug in the way we were accessing the URL argument. We
    would try to grab it from **kwargs even though it has its own keyword
    argument in the function signature. This made it so that the URL was
    never actually checked during unit tests. So even if the URL was wrong,
    the unit test wouldn't catch this. This change fixes that so we're
    properly grabbing the URL that was passed to assertHTTPCall.

    • Ran unit tests.
    • Changed a unit test so that an incorrect URL was passed to assertHTTPCall,
      saw that it failed whereas before this fix the test would still pass.
    • Tried passing the URL argument positionally instead of by keyword, test
      still passed.
    • Tried passing the URL argument by keyword as the 3rd argument in the list,
      instead of the 2nd (which is its position in the function signature), saw
      that tests still passed.

    Commits

    Files