Changes between Initial Version and Version 6 of Ticket #23641
- Timestamp:
- Oct 13, 2014, 12:05:44 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23641
- Property Triage Stage Unreviewed → Accepted
- Property Has patch set
-
Ticket #23641 – Description
initial v6 3 3 The signal dispatcher stores `id()` of the sender argument provided to `connect` to identify the sender that we're interested in receiving the signals from, in case of `post_migrate` signals this is often an id of an `AppConfig` for the registering app. When `set_installed_apps` is called it reinstantiates all app configs. If afterwards you send a signal using app config from the global app registry as the sender (as is the case in `emit_post_migrate_signal` when setting up test databases), its id won't match the one stored by the dispatcher, thus signal handlers won't get executed. 4 4 5 [https://github.com/wrwrwr/django/ tree/fix/missing-default-site-with-set-installed-apps A branch] with an example test case and a possible partial fix (that in full would be moving all module-level signal registration to `AppConfig.ready`).5 [https://github.com/wrwrwr/django/compare/ticket_23641 A branch] with an example test case and a possible fix. 6 6 7 7 [https://github.com/wrwrwr/mezzanine/blob/maintenance/1.8-discover-test-runner/mezzanine/utils/tests.py#L117 A sketch] of a possible more general solution / workaround (this Mezzanine wrapper for `DiscoverRunner` turned out pretty involved, you're welcome to suggest a cleaner implementation :-)