Fix unit test regressions with badges and conditionally access context.

Review Request #14368 — Created March 14, 2025 and discarded

Information

Review Board
release-7.1.x

Reviewers

When get_user_badges() was updated to take a local_site= parameter,
two unit tests failed to get the update. They were caught up in a stash.
These have been updated to take **kwargs.

Badge calculation also assumed the existence of request.local_site and
context['request']`, but these aren't always available, at least in unit
tests. We now access these conditionally.

All unit tests pass.

Summary ID
Fix unit test regressions with badges and conditionally access context.
When `get_user_badges()` was updated to take a `local_site=` parameter, two unit tests failed to get the update. They were caught up in a stash. These have been updated to take `**kwargs`. Badge calculation also assumed the existence of `request.local_site` and context['request']`, but these aren't always available, at least in unit tests. We now access these conditionally.
40f37da00d2fef339731e08527aaf5b1104c41fc
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Discarded
Loading...