Changes between Initial Version and Version 1 of Ticket #29226, comment 4
- Timestamp:
- Mar 18, 2018, 12:09:06 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29226, comment 4
initial v1 3 3 Sounds like a time-consuming issue for those who might encounter it. I agree with Tim that hopefully someone would think twice about this, but having dealt with issues related to dict key ordering myself, I have to admit that you get it wrong sometimes. 4 4 5 Also, the example in the docs would directly lead to the issue, except that it does append/remove/prepend the same items, but it stills seems like it would easily misguide someone to do that: https://docs.djangoproject.com/en/2.0/topics/testing/tools/#django.test.SimpleTestCase.modify_settings5 Also, the example in the docs [1] would directly lead to the issue, except that it does append/remove/prepend the same items, but it stills seems like it would easily misguide someone to do that 6 6 7 7 The solution that Markus and I just discussed was that you can A) use `OrderedDict` or B) add `modify_settings` twice like this: … … 28 28 Two suggestions: 29 29 30 1. Updating the (misguiding) example that does the above without elaborating lots about why it's applied several times: https://docs.djangoproject.com/en/2.0/topics/testing/tools/#django.test.SimpleTestCase.modify_settings30 1. Updating the (misguiding) docs example [1] so it applies `modify_settings` several times without elaborating lots about why- 31 31 1. Add a warning box about doing append+reject on the same items (re-ordering) 32 32 33 33 As I understand Tim's comment, the latter would be a bit over the top, but the former could be preferable as it wouldn't complicate the docs much? 34 35 [1] https://docs.djangoproject.com/en/2.0/topics/testing/tools/#django.test.SimpleTestCase.modify_settings