[Django] #37052: Cleanup: Added test coverage for camel_case_to_spaces utility

8 views
Skip to first unread message

Django

unread,
Apr 19, 2026, 5:10:18 PMApr 19
to django-...@googlegroups.com
#37052: Cleanup: Added test coverage for camel_case_to_spaces utility
-------------------------------------+-------------------------------------
Reporter: Sagar kumar | Type:
| Cleanup/optimization
Status: new | Component: Core
| (Serialization)
Version: 6.0 | Severity: Normal
Keywords: tests, utils, text | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
While investigating the `django.utils.text.camel_case_to_spaces` utility,
I noticed that it currently lacks comprehensive test coverage for several
common edge cases. While the function works as intended for standard
PascalCase, its behavior with acronyms, digits, and surrounding whitespace
isn't explicitly verified in the test suite.

I have developed a suite of test cases to be added to
`tests/utils_tests/test_text.py`. These tests ensure the utility handles:
**- Standard camelCase and PascalCase.
****- Strings containing acronyms (e.g., "HTTPResponse").
****- Alphanumeric strings (e.g., "Version2Update").
****- Edge cases like empty strings and leading/trailing whitespace.
**
Adding these tests will harden the utility against regressions during
future refactors and ensure consistent behavior across the framework where
this utility is used for human-readable labels.
--
Ticket URL: <https://code.djangoproject.com/ticket/37052>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 20, 2026, 2:16:00 PMApr 20
to django-...@googlegroups.com
#37052: Cleanup: Added test coverage for camel_case_to_spaces utility
-------------------------------------+-------------------------------------
Reporter: Sagar kumar | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Core | Version: 6.0
(Serialization) |
Severity: Normal | Resolution: invalid
Keywords: tests, utils, text | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* resolution: => invalid
* status: new => closed

Comment:

Hello Sagar Kumar, thank you for the contribution. After reviewing the
multiple patches you sent, we are closing this ticket.

The multiples patches you proposed were generated by an automated AI agent
(`copilot-swe-agent[bot]`), which is not acceptable per Django's
contributing guidelines. Contributors are expected to write code
themselves, understand it, and be able to defend it in review. Submitting
agent-generated code does not reflect the effort expected from
contributors, nor does it respect the time of the maintainers.

This is part of a broader pattern of submissions that have not followed
Django's contributing process. We encourage you to read the
[https://docs.djangoproject.com/en/dev/internals/contributing/ docs]
carefully before submitting further patches.
--
Ticket URL: <https://code.djangoproject.com/ticket/37052#comment:1>
Reply all
Reply to author
Forward
0 new messages