Changes between Initial Version and Version 1 of Ticket #34920


Ignore:
Timestamp:
Oct 21, 2023, 12:52:25 PM (7 months ago)
Author:
ksg
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34920 – Description

    initial v1  
    11`django.core.validators.FileExtensionValidator` had an '__eq__' method to compare the validator class. However, comparing arrays is not accurate when the order of elements in the arrays is different.
    22
    3 ```python
     3{{{
    44def __eq__(self, other):
    55    return (
     
    99        and self.code == other.code
    1010    )
    11 ```
     11}}}
    1212
    1313This test case failed:
    1414
    15 ```python
     15{{{
    1616self.assertEqual(
    1717    FileExtensionValidator(["jpg", "png", "txt"]),
    1818    FileExtensionValidator(["txt", "jpg", "png"]),
    1919)
    20 ```
     20}}}
    2121
    2222So I suggest comparing two extension arrays after sorting them.
Back to Top