Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[Django] #25889: Rename tests in queries tests

18 views
Skip to first unread message

Django

unread,
Dec 8, 2015, 2:53:27 AM12/8/15
to django-...@googlegroups.com
#25889: Rename tests in queries tests
------------------------------------------------+------------------------
Reporter: claudep | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
There are a bunch of `test_ticket_<number>` tests in
`tests/queries/tests.py` or classes named `Ticket<number>Tests`, sometimes
without any docstring at all. I think that this is very poor naming, and
make it difficult to browse the file researching for specific tests or
test domains.
I'm sure other test apps also suffer from this, but I was struck by this
specific file and this could be a starting point for a larger cleanup.

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

Django

unread,
Dec 8, 2015, 7:44:58 AM12/8/15
to django-...@googlegroups.com
#25889: Organize tests in queries tests
--------------------------------------+------------------------------------

Reporter: claudep | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

* cc: akaariai (added)
* stage: Unreviewed => Accepted


Comment:

I think the issue is that for queries tests, they are not easily
categorized or described. Many of the tickets are "here is query that
regressed." If we can break up the single `tests.py` file into multiple
tests files (perhaps based on the models they use) and `models.py` into a
package similar to `tests/auth_tests/models`, I think that would be a
useful task. If we can do some renaming along the way, that seems okay but
it would be easiest to review in a separate commit from one that moves
things around.

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

Django

unread,
Dec 8, 2015, 10:00:12 AM12/8/15
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
--------------------------------------+------------------------------------

Reporter: claudep | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

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

Django

unread,
Jan 27, 2017, 10:17:16 PM1/27/17
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: reficul31
Type: | Status: assigned
Cleanup/optimization |

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by reficul31):

* status: new => assigned
* owner: nobody => reficul31


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

Django

unread,
Jan 29, 2017, 6:31:21 AM1/29/17
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: reficul31
Type: | Status: assigned
Cleanup/optimization |
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by reficul31):

After cleaning most of the method names and adding some context in
comments. There are some methods that have multiple tests. Eg.
test_ticketno_1 then we have test_ticketno_2. What should be done with
such tests. We could group them into a single class maybe and provide some
additional information in the comments? Or we could have like
test_context_of_test_1?

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

Django

unread,
Jan 30, 2017, 10:38:49 AM1/30/17
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: reficul31
Type: | Status: assigned
Cleanup/optimization |
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by reficul31):

Replying to [comment:1 Tim Graham]:


> If we can break up the single `tests.py` file into multiple tests files
(perhaps based on the models they use) and `models.py` into a package
similar to `tests/auth_tests/models`, I think that would be a useful task.
If we can do some renaming along the way, that seems okay but it would be
easiest to review in a separate commit from one that moves things around.

I think this sort of thing won't be easy. As most of the models aren't
reused. If the patch required something there was a high chance that the
contributor made the model similar to that given in the ticket. According
to me the maximum we can do is to rename the tests such that they provide
the context of what the test is for without loosing the information
provided by the original author of the test.

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

Django

unread,
Jan 30, 2017, 11:28:14 PM1/30/17
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: reficul31
Type: | Status: assigned
Cleanup/optimization |
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by reficul31):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[[https://github.com/django/django/pull/7993|PR]]

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

Django

unread,
Feb 6, 2021, 10:49:26 AM2/6/21
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
--------------------------------------+------------------------------------
Reporter: Claude Paroz | Owner: (none)

Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* owner: reficul31 => (none)
* status: assigned => new


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

Django

unread,
Mar 18, 2024, 3:17:30 AM3/18/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
--------------------------------------+------------------------------------
Reporter: Claude Paroz | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)

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

Django

unread,
Jul 13, 2024, 5:20:52 PM7/13/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
--------------------------------------+------------------------------------
Reporter: Claude Paroz | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Wassef Ben Ahmed):

* needs_docs: 0 => 1

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

Django

unread,
Jul 13, 2024, 5:21:36 PM7/13/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Wassef
Type: | Ben Ahmed
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Wassef Ben Ahmed):

* needs_docs: 1 => 0
* owner: (none) => Wassef Ben Ahmed
* status: new => assigned

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

Django

unread,
Jul 21, 2024, 8:35:52 AM7/21/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Wassef
Type: | Ben Ahmed
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Wassef Ben Ahmed):

* needs_better_patch: 1 => 0

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

Django

unread,
Jul 26, 2024, 11:34:55 AM7/26/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Wassef
Type: | Ben Ahmed
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

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

Django

unread,
Aug 8, 2024, 7:54:33 AM8/8/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Wassef
Type: | Ben Ahmed
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Wassef Ben Ahmed):

* needs_better_patch: 1 => 0

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

Django

unread,
Aug 8, 2024, 9:24:31 AM8/8/24
to django-...@googlegroups.com
#25889: Organize tests in tests/queries
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Wassef
Type: | Ben Ahmed
Cleanup/optimization | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/25889#comment:14>
Reply all
Reply to author
Forward
0 new messages