$ the-wire · showcase
Django's core test suite declares war on undefined SQL row order
By RepoJournal · Filed · About Django
Django's own tests are about to stop pretending PostgreSQL returns rows in insertion order, and that changes how you should trust your queries.
A top-story PR [1] fixes ~70 tests that rely on implicit SELECT ordering, a SQL standard violation that only passes by coincidence on PostgreSQL. The fix, also in [2], means your ORM queries without an ORDER BY were never guaranteed stable, and the test suite is finally catching up. Meanwhile, djangoproject.com rotated ten-year-old Stripe test API keys [3], a security hygiene win that removes keys that were "theoretically usable" and hard to set up due to missing product IDs. The site also moved toward sponsorships with a banner link [5] and a header change from 'Donate' to 'Sponsor' [6], signaling a strategic pivot in funding messaging. On the dev side, path() and re_path() now report the invalid view type in their TypeError [4], a small debugging win, and accessibility docs got their broken references fixed [7]. The 7 commits and 6 PRs across these repos show steady cleanup, not revolution.
Action items
- → Review your Django querysets for implicit ordering assumptions and add explicit ORDER BY where row order matters django/django [immediate]
- → Rotate any Stripe test keys committed before 2014 and ensure sandbox keys have restricted permissions django/djangoproject.com [immediate]
- → Watch the djangoproject.com sponsorship banner rollout for impact on donation conversion django/djangoproject.com [monitor]
References
- [1] Fixed #37255 -- Avoided relying on implicit SELECT ordering in tests. ↗ django/django
- [2] Fixed #37255 -- Avoided relying on implicit SELECT ordering in tests. django/django
- [3] Configured Stripe sandbox and products. ↗ django/djangoproject.com
- [4] Fixed #37296 -- Included the invalid view type in path()/re_path() error. django/django
- [5] :handshake: Adds sponsor link to banner template (#2800) django/djangoproject.com
- [6] Change 'Donate' link to 'Sponsor' in header ↗ django/djangoproject.com
- [7] Fixed #37301 -- Fixed broken references in accessibility documentation. django/django