Add url_name parameter to TestCase.create_http_request

Review Request #12823 — Created Feb. 3, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

In order to be able to use create_http_request for tests related to
URL names (for example, extensions or actions that use apply_to), we
need to set the URL name on the ResolverMatch. This adds a parameter
to the test helper to let us set that.

This also fixes up usage with local sites, where we were setting
Request.local_site but not Request._local_site_name.

Testing Done:
Used in conjunction with other changes.

More testcase

Used in conjunction with other changes.

Summary ID
Add url_name parameter to TestCase.create_http_request
In order to be able to use `create_http_request` for tests related to URL names (for example, extensions or actions that use `apply_to`), we need to set the URL name on the `ResolverMatch`. This adds a parameter to the test helper to let us set that. This also fixes up usage with local sites, where we were setting `Request.local_site` but not `Request._local_site_name`. Testing Done: Used in conjunction with other changes. More testcase
95a68647b6f5dc2b0023bd1e60f9b323351aae97
Description From Last Updated

do not assign a lambda expression, use a def Column: 17 Error code: E731

reviewbotreviewbot

) -> HttpRequest should be on the next line, unindented a level. **kwargs should have a trailing comma.

chipx86chipx86

Can you add a Version Added for this, and a Version Changed on the method? Even though they're unit tests, …

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
chipx86
  1. 
      
  2. reviewboard/testing/testcase.py (Diff revision 2)
     
     
    Show all issues

    ) -> HttpRequest should be on the next line, unindented a level. **kwargs should have a trailing comma.

  3. reviewboard/testing/testcase.py (Diff revision 2)
     
     
     
     
    Show all issues

    Can you add a Version Added for this, and a Version Changed on the method?

    Even though they're unit tests, this has been very helpful in the past when trying to backport stuff.

  4. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (ad79fb3)