[Django] #33990: Inconsistent capitalization of Set in assertion functions

4 views
Skip to first unread message

Django

unread,
Sep 7, 2022, 8:14:09 AM9/7/22
to django-...@googlegroups.com
#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.

Django

unread,
Sep 8, 2022, 4:18:00 PM9/8/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Anvansh
| Singh
Type: Uncategorized | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage:
capitalization, camelcase | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anvansh Singh):

* owner: nobody => Anvansh Singh
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:1>

Django

unread,
Sep 13, 2022, 5:09:16 AM9/13/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Anvansh
Type: | Singh
Cleanup/optimization | Status: assigned

Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

OK — I'm not 100% convinced this is worth the change, so if someone wants
to mark it `wontfix` I won't complain, but… —  let's accept as a cleanup
for the `assertFormsetError` and `assertQuerysetEqual` methods.

* Uses in Django will need to be updated.
* The old names will need to be deprecated. (Let's not have two versions
floating around...)
* A matching Issue/PR should be created on The
[https://github.com/adamchainz/django-upgrade django-upgrade project] when
this goes in.

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:2>

Django

unread,
Sep 24, 2022, 11:12:23 AM9/24/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz

Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Howitz):

* owner: Anvansh Singh => Michael Howitz


Comment:

Taking over the assignment as I am on a sprint and able to work on it.

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:3>

Django

unread,
Sep 25, 2022, 5:12:48 AM9/25/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Howitz):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:4>

Django

unread,
Sep 25, 2022, 6:09:09 AM9/25/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

Just checking the docs to see how things are named there compared to the
code: Looks like QuerySet is capitalised as per code but "Formset" tends
to use classic sentence casing:

ie see how QuerySet is used in a sentence:
https://docs.djangoproject.com/en/4.1/ref/models/querysets/

compared to how "formset" is used in a sentence:
https://docs.djangoproject.com/en/4.1/topics/forms/formsets/

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:5>

Django

unread,
Sep 25, 2022, 6:09:30 AM9/25/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Sanders):

* cc: David Sanders (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:6>

Django

unread,
Sep 25, 2022, 9:20:12 AM9/25/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Michael Howitz):

The issue in `django-upgrade` is https://github.com/adamchainz/django-
upgrade/issues/252.

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:7>

Django

unread,
Sep 25, 2022, 11:03:54 AM9/25/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Michael Howitz):

The PR in `django-upgrade` is https://github.com/adamchainz/django-
upgrade/pull/253.

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:8>

Django

unread,
Sep 26, 2022, 3:43:37 AM9/26/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1


Comment:

[https://github.com/django/django/pull/16110 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:9>

Django

unread,
Oct 7, 2022, 2:31:00 AM10/7/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Howitz):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:10>

Django

unread,
Oct 7, 2022, 6:36:08 AM10/7/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"564b317fb53e9925b86ca5ef5d3bbcf99387602c" 564b317f]:
{{{
#!CommitTicketReference repository=""
revision="564b317fb53e9925b86ca5ef5d3bbcf99387602c"
Refs #33990 -- Renamed SimpleTestCase.assertFormsetError() to
assertFormSetError().

Co-Authored-By: Michael Howitz <m...@gocept.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:11>

Django

unread,
Oct 7, 2022, 8:58:07 AM10/7/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Accepted
capitalization, camelcase |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:12>

Django

unread,
Oct 8, 2022, 2:13:23 AM10/8/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Ready for
capitalization, camelcase | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:13>

Django

unread,
Oct 8, 2022, 2:28:04 PM10/8/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution:
Keywords: naming, | Triage Stage: Ready for
capitalization, camelcase | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"f0c06f8ab7904e1fd082f2de57337f6c7e05f177" f0c06f8a]:
{{{
#!CommitTicketReference repository=""
revision="f0c06f8ab7904e1fd082f2de57337f6c7e05f177"
Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to
assertQuerySetEqual().

Co-Authored-By: Michael Howitz <m...@gocept.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:14>

Django

unread,
Oct 8, 2022, 2:31:01 PM10/8/22
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: closed

Component: Testing framework | Version: 4.1
Severity: Normal | Resolution: fixed

Keywords: naming, | Triage Stage: Ready for
capitalization, camelcase | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:15>

Django

unread,
Sep 18, 2023, 4:12:53 PM9/18/23
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: closed
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: naming, | Triage Stage: Ready for
capitalization, camelcase | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"69af3bea9987044c944b5bc83e32c35f0a73c6dd" 69af3bea]:
{{{
#!CommitTicketReference repository=""
revision="69af3bea9987044c944b5bc83e32c35f0a73c6dd"
Refs #33990 -- Removed TransactionTestCase.assertQuerysetEqual() per
deprecation timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:17>

Django

unread,
Sep 18, 2023, 4:12:53 PM9/18/23
to django-...@googlegroups.com
#33990: Inconsistent capitalization of Set in assertion functions
-------------------------------------+-------------------------------------
Reporter: John Litborn | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: closed
Component: Testing framework | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: naming, | Triage Stage: Ready for
capitalization, camelcase | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"c35fd9e2750a3e49a57d9fef964b9ef3e7cb49cb" c35fd9e2]:
{{{
#!CommitTicketReference repository=""
revision="c35fd9e2750a3e49a57d9fef964b9ef3e7cb49cb"
Refs #33990 -- Removed SimpleTestCase.assertFormsetError() per deprecation
timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33990#comment:16>

Reply all
Reply to author
Forward
0 new messages