Hi Grant, for future reference django-developers isn't meant as a second level support channel if you don't get a reply on -users. Thanks!
On Friday, August 14, 2015 at 5:58:52 PM UTC-4, jdunck wrote: > > I suspect you have 2 different definitions of the signal under different > import paths. Ensure your python path doesn't have overlapping > directories, and that your signal imports refer to the same sys.modules key > (e.g. some_app.signals.foo all over, not proj.some_app.signals.foo and > some_app.signals.foo in various places). > > This might help troubleshoot: > https://gist.github.com/jdunck/857091 > > > > > > On Fri, Aug 14, 2015 at 2:39 PM, Grant Means <[email protected] > <javascript:>> wrote: > >> I posted this in Django users but didn't get any reply. I hope you don't >> mind me asking here. I does involve Django internals. >> >> Simply put, I have an app that has a model that's consumed by other >> "pluggable" apps. This model will send certain signals during certain >> events that the pluggable apps can consume and respond to. >> >> I'd like to test that my model indeed sends the expected signal during >> specific actions. I wrote a test that connects to the signal in setUp() and >> uses a local listener function to set a class attribute to True if the >> handler is called. You can see the relevant code here: >> >> https://dpaste.de/mAGw >> >> This works fine if I test the module directly using ./manage.py test >> <app> test_models.py. However if I run test <app> or simply test the >> signals don't appear to connect. Using PyCharm I stepped through the code >> and found that when I call .connect() in my TestCase, and step into >> Signal.connect() I can see all of the expected receivers on >> `self.receivers`. >> >> However if I step into the Signal.send() method when the signal is fired, >> none of the expected receivers are in place. Again, this works if I test >> the module directly just not if I use `test <app>` or `test`. >> >> Does anyone have any guidance on how I could get this to work? Thanks! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django developers (Contributions to Django itself)" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/django-developers. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-developers/6d8a3d9b-b04b-4a08-93c4-8363834e41b2%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-developers/6d8a3d9b-b04b-4a08-93c4-8363834e41b2%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1afa6063-60a1-4702-809d-cb8175f1813a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
