[Django] #34655: Tests for RadioSelect and Select have diverged considerably, potentially leaving RadioSelect undertested

0 views
Skip to first unread message

Django

unread,
Jun 14, 2023, 11:11:09 AM6/14/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
------------------------------------------------+------------------------
Reporter: Natalia Bidart | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
Even though `Select` and `RadioSelect` both share most of the
functionality by inheriting from `ChoiceWidget`, there are no explicit
tests for `ChoiceWidget`, and tests for `Select` and `RadioSelect` have
diverged considerably over time.

While some tests will be specific to each children (for their custom
code), after inspection when reviewing
[https://github.com/django/django/pull/16929/ PR] for #34034, there seems
to be some tests that were added to `Select` but not added to their
counterpart `RadioSelect`, for example `test_deepcopy`.

My hope with this ticket is to either:

* evaluate the creation of specific tests for `ChoiceWidget` and have
tests for `Select` and `RadioSelect` reusing those, and then having
custom tests for their custom functionality

* extend the tests for `RadioSelect` using those for `Select` as a guide
and have some sort of comment suggesting to grow both test suites when
making changes to their parent class.

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

Django

unread,
Jun 14, 2023, 1:42:11 PM6/14/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
--------------------------------------+------------------------------------

Reporter: Natalia Bidart | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: 4.2
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 Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

For the future, extra test coverage is always welcome, no ticket required.

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

Django

unread,
Jun 14, 2023, 3:38:49 PM6/14/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Jacob1507
Type: | Status: assigned
Cleanup/optimization |

Component: Forms | Version: 4.2
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 Jacob1507):

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


Comment:

Hello, I would like to attempt working on this ticket

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

Django

unread,
Jun 21, 2023, 2:04:12 PM6/21/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Jacob1507
Type: | Status: assigned
Cleanup/optimization |
Component: Forms | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

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


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

Django

unread,
Jul 20, 2023, 10:39:51 AM7/20/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Faishal
Type: | manzar
Cleanup/optimization | Status: assigned

Component: Forms | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Faishal manzar):

* owner: Jacob1507 => Faishal manzar


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

Django

unread,
Jul 21, 2023, 3:11:34 PM7/21/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Jacob1507
Type: | Status: assigned
Cleanup/optimization |
Component: Forms | Version: 4.2
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 Mariusz Felisiak):

* owner: Faishal manzar => Jacob1507
* needs_better_patch: 1 => 0


Comment:

As far as I'm aware, it's waiting for another review by Natalia.

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

Django

unread,
Jul 28, 2023, 8:18:17 AM7/28/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Jacob1507
Type: | Status: closed

Cleanup/optimization |
Component: Forms | Version: 4.2
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 GitHub <noreply@…>):

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


Comment:

In [changeset:"f9c5958b8fe452983122b6a13c8f806e4e4e1eef" f9c5958]:
{{{
#!CommitTicketReference repository=""
revision="f9c5958b8fe452983122b6a13c8f806e4e4e1eef"
Fixed #34655 -- Increased radioselect's test coverage.
}}}

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

Django

unread,
Jul 28, 2023, 8:18:46 AM7/28/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Jacob1507
Type: | Status: closed
Cleanup/optimization |
Component: Forms | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


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

Django

unread,
Jul 31, 2023, 2:17:21 PM7/31/23
to django-...@googlegroups.com
#34655: Tests for RadioSelect and Select have diverged considerably, potentially
leaving RadioSelect undertested
-------------------------------------+-------------------------------------
Reporter: Natalia Bidart | Owner: Jacob1507
Type: | Status: closed
Cleanup/optimization |
Component: Forms | Version: 4.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"1ad7761ee616341295f36c80f78b86ff79d5b513" 1ad7761]:
{{{
#!CommitTicketReference repository=""
revision="1ad7761ee616341295f36c80f78b86ff79d5b513"
Refs #34655 -- Made cosmetic edits to RadioSelect tests.

Follow up to f9c5958b8fe452983122b6a13c8f806e4e4e1eef.
}}}

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

Reply all
Reply to author
Forward
0 new messages