[Django] #22909: Fix camelCase test names

72 views
Skip to first unread message

Django

unread,
Jun 26, 2014, 3:15:11 PM6/26/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
------------------------------------------------+------------------------
Reporter: timo | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
In some test files like `tests/admin_widgets/tests.py`, there are tests
with names like `testDateField` where it should be `test_date_field`. Note
that it's fine for assertions to be camel cased, so there's no need to
change things like `assertFormfield`. I have seen this most often in the
`admin_*` tests, so those would be the main ones to check.

--
Ticket URL: <https://code.djangoproject.com/ticket/22909>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 29, 2014, 5:44:35 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by brylie):

* owner: nobody => brylie
* status: new => assigned
* cc: brylie (added)


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

Django

unread,
Jun 29, 2014, 5:44:47 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------

Reporter: timo | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

The '''admin_custom_urls''' package has camel case tests.

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

Django

unread,
Jun 29, 2014, 5:47:39 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''admin_filters''' may need consistent spacing in test functions in the
''ListFiltersTests'' class. Please review and comment as to whether
spacing/underscores should be changed.

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

Django

unread,
Jun 29, 2014, 5:55:47 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''admin_views''' has several camel case test names.

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

Django

unread,
Jun 29, 2014, 5:57:27 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''admin_widgets''' needs cleanup.

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

Django

unread,
Jun 29, 2014, 6:04:20 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''bug639''' has one camel case test name. Should this test be moved into
another, more general, test module?

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

Django

unread,
Jun 29, 2014, 6:15:16 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''conditional_processing''' needs cleanup.

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

Django

unread,
Jun 29, 2014, 6:33:58 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''dispatch''' needs work. Also, the tests were created in a sub-
directory: ''dispatch/tests/test_dispatcher.py''

Should the tests be moved up to the ''dispatch'' directory, and possibly
renamed ''tests.py''?

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

Django

unread,
Jun 29, 2014, 6:53:19 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''file_uploads''' has set up and tear down classes that are named
''setUpClass'' and ''tearDownClass''. Should these be renamed to ''setUp''
and ''tearDown''?

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

Django

unread,
Jun 29, 2014, 6:55:18 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''fixtures''' has two test functions named ''testClassFixtures''.

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

Django

unread,
Jun 29, 2014, 6:59:00 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''fixtures_model_package''' has one function named ''testClassFixtures''.
Should this be renamed?

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

Django

unread,
Jun 29, 2014, 7:07:25 AM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''generic_inline_admin''' has camel case test names.

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

Django

unread,
Jun 29, 2014, 12:49:48 PM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''model_fields''' contains a function without a camel case for the field
name: ''test_slugfield_max_length''

This is inconsistent with other field names in test functions. Should this
be changed to ''test_SlugField_max_length''?

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

Django

unread,
Jun 29, 2014, 6:15:25 PM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''nested_foreign_keys''' has camel case test names.

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

Django

unread,
Jun 29, 2014, 6:31:03 PM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''raw_query''' has camel case test names.

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

Django

unread,
Jun 29, 2014, 7:09:15 PM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''unit_tests/test_http''' has camel case test names.

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

Django

unread,
Jun 29, 2014, 7:17:21 PM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

'''view_tests/tests/test_i18n''' has camel case test names.

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

Django

unread,
Jun 29, 2014, 7:25:56 PM6/29/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timo):

Thanks for looking at this. Let's just focus on camel case test names for
this ticket. We can open a separate one for some of the other issues you
raised.

To address some specific questions:
* admin_filters -- think it's fine to leave as-is.
* bug* -- yes, let's move them, but as a separate item.
* dispatch -- probably move them as a separate item.
* file_uploads -- setUpClass/tearDownClass are fine.
* model_fields -- I'd remove the existing camel case for field names.

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:18>

Django

unread,
Jun 30, 2014, 5:11:16 AM6/30/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

Replying to [comment:1 brylie]:


> The '''admin_custom_urls''' package has camel case tests.

Fixed.

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:19>

Django

unread,
Jun 30, 2014, 9:46:37 AM6/30/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

Replying to [comment:18 timo]:


> * model_fields -- I'd remove the existing camel case for field names.

Ah, dang. I just went with the opposite and ''added'' camel case to field
names in tests. I think this is a good strategy for two reasons:
1. It is consistent with other tests/test suites
1. It improves readability, which seems to be a priority here

Does this seem reasonable?

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:20>

Django

unread,
Jun 30, 2014, 11:17:08 AM6/30/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by brylie):

OK, I have modified the files where I found camel case test names. Please
review the following changes, so that I may submit a pull request:

*
[https://github.com/brylie/django/commit/e5fbf9087a0ea2e688e7fd351b174c88eba3e5a6
admin_custom_urls]
*
[https://github.com/brylie/django/commit/b18def65987d7c4903ad00f84b1b42780b09a8d2
admin_views]
*
[https://github.com/brylie/django/commit/0970cf6149b3f630a0c029b5decb904c5b3aab58
admin_widgets]
*
[https://github.com/brylie/django/commit/2a935773f8c16c42f5a77ee208d7ac8d8b9f7a71
conditional_processing]
*
[https://github.com/brylie/django/commit/4931cff49cd56ba8deb705f848f9b1aafb17a516
dispatch]
*
[https://github.com/brylie/django/commit/e81b0cd48c7fdde48a62ae3727fc45f128b4bed2
generic_inline_admin]
*
[https://github.com/brylie/django/commit/7051550346830a9ac58c192551900582ca93bf62
model_fields]
*
[https://github.com/brylie/django/commit/bf34e6190df549374cfec224e6ab91583bbefe6e
nested_foreign_keys]
*
[https://github.com/brylie/django/commit/f12558b8b9db7f8a43f018c7735ade57ebaf2930
raw_query]
*
[https://github.com/brylie/django/commit/fa19d6014682fcd01f6014244f31685d02556900
utils_tests/test_http]
*
[https://github.com/brylie/django/commit/bdbcc5090719bfd9e57ef2f1ff7925e3dbed3a9c
view_tests/tests/i18n]

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:21>

Django

unread,
Jun 30, 2014, 11:32:24 AM6/30/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:22>

Django

unread,
Jul 7, 2014, 7:11:03 PM7/7/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"89b9e6e5d68297e7fe10baea6abcd96e24de0e09"]:
{{{
#!CommitTicketReference repository=""
revision="89b9e6e5d68297e7fe10baea6abcd96e24de0e09"
Fixed #22909 -- Removed camelCasing in some tests.

Thanks brylie.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:23>

Django

unread,
Jul 7, 2014, 7:11:18 PM7/7/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"28962c57f3f2b4543cd67d55ca635e9198f585dd"]:
{{{
#!CommitTicketReference repository=""
revision="28962c57f3f2b4543cd67d55ca635e9198f585dd"
[1.7.x] Fixed #22909 -- Removed camelCasing in some tests.

Thanks brylie.

Backport of 89b9e6e5d6 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:24>

Django

unread,
Jul 8, 2014, 9:04:09 AM7/8/14
to django-...@googlegroups.com
#22909: Fix camelCase test names
--------------------------------------+------------------------------------
Reporter: timo | Owner: brylie
Type: Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timo):

I moved the dispatch tests in 136a3ffe21988d49e443867d129cc01fb62b34cd and
created #22979 for moving the bug tests.

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:25>

Django

unread,
Nov 30, 2020, 12:35:03 AM11/30/20
to django-...@googlegroups.com
#22909: Fix camelCase test names
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Brylie
Type: | Christopher Oxley

Cleanup/optimization | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
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:"58740c0d7f441e7a12e5847fcd7409a78d9edd7b" 58740c0d]:
{{{
#!CommitTicketReference repository=""
revision="58740c0d7f441e7a12e5847fcd7409a78d9edd7b"
Refs #22909 -- Removed camelCasing in auth_tests.test_templates tests.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22909#comment:26>

Reply all
Reply to author
Forward
0 new messages