Ticket #596 (assigned defect)
South emits signals which do not honor Django's expectations.
|Reported by:||Alexis Petrounias||Owned by:||andrew|
During unit testing for any project with South installed, Model signals (such as post_delete) are being issued by South with MigrationHistory? as the sender. It appears that the sender does not satisfy all of Django's expectations.
Specifically, it is not possible to load the ContentType? of the sender, as the following code:
will result in the following exception:
... ContentType.objects.get_for_model(sender) ... File ".../django/contrib/contenttypes/models.py", line 40, in get_for_model self._add_to_cache(self.db, ct) File ".../django/contrib/contenttypes/models.py", line 70, in _add_to_cache key = (model._meta.app_label, model._meta.object_name.lower()) AttributeError: 'NoneType' object has no attribute '_meta'
A workaround is to check at the signal listener whether the sender of a signal is MigrationHistory? and ignore the signal, however, this is ad-hoc and creates an explicit South dependency.