← Back to Pull requests

Fix override_config test decorator on Django 5.2 #609

Closed
unknown closed this pull request without merging on Feb 04, 2025 21:11 UTC
View on GitHub
unknown unknown commented on Jan 27, 2025 10:59 UTC
Author

Yet another Django 5.2 fix:

Django 5.2 is the first version to ship this PR turning pre_setup into a classmethod and generating this error (already visible in tox, but ignored)

  ERROR: test_override_config_on_class_changes_config_value (tests.test_test_overrides.OverrideConfigClassDecoratorTestCase.test_override_config_on_class_changes_config_value)
  Assert that the class decorator changes config.BOOL_VALUE.
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/runner/work/django-constance/django-constance/constance/test/unittest.py", line 49, in _pre_setup
      original_pre_setup(inner_self)
  TypeError: TransactionTestCase._pre_setup() takes 1 positional argument but 2 were given

I found this fix, following the current solution but maybe a better (and more modern) solution exists
"""
Override the config by modifying TestCase methods.

This method follows the Django <= 1.6 method of overriding the
_pre_setup and _post_teardown hooks rather than modifying the TestCase
itself.
"""

Diff: 145 lines (+108 / -37) across 1 files Reviewer: Mogost Review duration: 12131m
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.56) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.56 · 145 lines diff across 1 files
0.56
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.298
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.056
Real PR Conversation Timeline
1 comments
"Review active on #609"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 56.0% (MEDIUM) · Higher = larger blast radius
56.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 22.1% · Safe to merge
22.1%