#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: jakkdl | Owner: nobody
Type: | Status: new
Uncategorized |
Component: Testing | Version: 4.1
framework | Keywords: naming,
Severity: Normal | capitalization, camelcase
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
FormSet and QuerySet for some reason doesn't have a capitalized S in
`assertFormsetError` and `assertQuerysetEqual`, whereas all other
instances of camel-cased names in the codebase containing either of them
have capitalized S's: (InlineAdminFormSet, Base[...]FormSet,
EmptyQuerySet, RawQuerySet).
Looking at the other assertion methods inherited from `unittest.TestCase`
they're incredibly cased (e.g. `assertMultiLineEqual`) so I'm not finding
any convention of not uppercasing liberally.
My suggestion is to rename `assertFormsetError`->`assertFormSetError` and
`assertQuerysetEqual`->`assertQuerySetEqual` in `django.test.TestCase` and
add aliases for the old names so as not to break existing code. In the
code base this is a quite small change, but there's likely some docs (and
e.g. the tutorial) that might warrant updating to new spelling. Could also
(down the line) add a deprecationwarning to get rid of the old spelling if
you want a cleaner API interface.
This bit me as I was following the tutorial and re-typing the code instead
of copy-pasting, so it's plausible that others might encounter it
similarly if they don't have an IDE that suggests the alternate spelling.
--
Ticket URL: <https://code.djangoproject.com/ticket/33990>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018317df30f6-ff02feb0-67cf-4fd6-9243-298fcb8f8f63-000000%40eu-central-1.amazonses.com.