Fix unit test regressions with badges and conditionally access context.
Review Request #14368 — Created March 14, 2025 and discarded — Latest diff uploaded
When
get_user_badges()
was updated to take alocal_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.
reviewboard/accounts/templatetags/accounts.py |
---|
reviewboard/accounts/tests/test_template_tags.py |
---|