Update tests for % change in 5.0

Review Request #14748 — Created Dec. 23, 2025 and updated

Information

Django Evolution
master

Reviewers

Django 5.0 changed its handling of % characters for mysql and postgres,
and these are no longer duplicated in the SQL. This change adds
conditions in the test data to handle this.

Ran unit tests.

Summary ID
Update tests for % change in 5.0
Django 5.0 changed its handling of % characters for mysql and postgres, and these are no longer duplicated in the SQL. This change adds conditions in the test data to handle this. Testing Done: Ran unit tests.
mzykvrrmprzvppruzszusrnkxqwruyrs
Description From Last Updated

The approach I usually take for changes like this is to define a constant for the expected value once (with …

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    The approach I usually take for changes like this is to define a constant for the expected value once (with a comment) and then use that in the strings. This both communicates the change in the test code in one place and reduces the number of string expectations (which has a tendency to grow in complexity).

    When we do need to differentiate string expectations based on version, we should do so mimimally, so rather than re-list every string, we only do so for the ones that differ.

  3. 
      
david
Review request changed
Commits:
Summary ID
Update tests for % change in 5.0
Django 5.0 changed its handling of % characters for mysql and postgres, and these are no longer duplicated in the SQL. This change adds conditions in the test data to handle this. Testing Done: Ran unit tests.
mzykvrrmprzvppruzszusrnkxqwruyrs
Update tests for % change in 5.0
Django 5.0 changed its handling of % characters for mysql and postgres, and these are no longer duplicated in the SQL. This change adds conditions in the test data to handle this. Testing Done: Ran unit tests.
mzykvrrmprzvppruzszusrnkxqwruyrs

Checks run (2 succeeded)

flake8 passed.
JSHint passed.