Changes between Initial Version and Version 1 of Ticket #34920
- Timestamp:
- Oct 21, 2023, 12:52:25 PM (13 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34920 – Description
initial v1 1 1 `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. 2 2 3 ```python 3 {{{ 4 4 def __eq__(self, other): 5 5 return ( … … 9 9 and self.code == other.code 10 10 ) 11 ``` 11 }}} 12 12 13 13 This test case failed: 14 14 15 ```python 15 {{{ 16 16 self.assertEqual( 17 17 FileExtensionValidator(["jpg", "png", "txt"]), 18 18 FileExtensionValidator(["txt", "jpg", "png"]), 19 19 ) 20 ``` 20 }}} 21 21 22 22 So I suggest comparing two extension arrays after sorting them.