Changes between Version 8 and Version 12 of Ticket #28752
- Timestamp:
- Nov 4, 2017, 5:59:10 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28752
- Property Summary django.setup() should be idempotent → django.setup() should not be runnable multiple times
-
Ticket #28752 – Description
v8 v12 18 18 These "duplicate calls" often involve the collision between manage.py commands, tests, custom scripts, and external launchers like pytest-django. Plus maybe some corner cases when unittest-style TestCases and pytest-style test functions are mixed in the same project. 19 19 20 Users have to do a real gym to call setup() "at some moment" in all these use cases, yet try to prevent multiple calls of this initialization step (like the 'if__name__ == "main"'protection). So far my only way out was often to check for (not really undocumented) states of the framework before calling setup().20 Users have to do a real gym to call setup() "at some moment" in all these use cases, yet try to prevent multiple calls of this initialization step (like the `if__name__ == "main"'` protection). So far my only way out was often to check for (not really undocumented) states of the framework before calling setup().