#34731 closed Bug (fixed)

Django test suite still has an occurence of assertEquals, removed in Python 3.12

Reported by: Michel Alexandre Salim Owned by: Michel Alexandre Salim
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Michel Alexandre Salim)

Python 3.12, shipping in the upcoming Fedora 39, finally removed the deprecated assertEquals in favor of assertEqual. The Django test suite mostly use the latter already, but there is one occurence of the former left. It should be converted.

Test failure on Python 3.12:

======================================================================                                                              
ERROR: test_condition_with_func_and_lookup_outside_relation_name (filtered_relation.tests.FilteredRelationTests.test_condition_with_
func_and_lookup_outside_relation_name)                                                                                              
----------------------------------------------------------------------                                                              
Traceback (most recent call last):                                                                                                  
  File "/home/michel/src/github/django/django/tests/filtered_relation/tests.py", line 652, in test_condition_with_func_and_lookup_ou
tside_relation_name 
    self.assertEquals(qs.count(), 1)                                                                                                
    ^^^^^^^^^^^^^^^^^                                                                                                               
AttributeError: 'FilteredRelationTests' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?

Change History (5)

comment:1 by Michel Alexandre Salim, 14 months ago

Owner: changed from nobody to Michel Alexandre Salim
Status: newassigned

comment:2 by Michel Alexandre Salim, 14 months ago

Description: modified (diff)

comment:3 by Mariusz Felisiak, 14 months ago

Triage Stage: UnreviewedAccepted

Good catch, my bad.

comment:4 by Mariusz Felisiak, 14 months ago

Triage Stage: AcceptedReady for checkin

comment:5 by GitHub <noreply@…>, 14 months ago

Resolution: fixed
Status: assignedclosed

In 62b83889:

Fixed #34731, Refs #34118 -- Replaced assertEquals() with assertEqual() in test_condition_with_func_and_lookup_outside_relation_name().

Signed-off-by: Michel Alexandre Salim <salimma@…>

Note: See TracTickets for help on using tickets.
Back to Top