Opened 3 weeks ago

Closed 3 weeks ago

#37052 closed Cleanup/optimization (invalid)

Cleanup: Added test coverage for camel_case_to_spaces utility

Reported by: Sagar kumar Owned by:
Component: Core (Serialization) Version: 6.0
Severity: Normal Keywords: tests, utils, text
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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.

Change History (1)

comment:1 by Natalia Bidart, 3 weeks ago

Resolution: invalid
Status: newclosed

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 docs carefully before submitting further patches.

Note: See TracTickets for help on using tickets.
Back to Top