def iterator(self): if settings.TESTING: # # When testing, with current Django (1.5.1) the LiveServerTestCase # servers only one thread for the server. So, if we listen for # Redis messages, we block the only socket of the test server. So, # to be able to test Javascript in web browsers (EventSource # support) we just fake incoming messages. Yes, this does not # test our Redis communication properly. On the other hand, # I rather leave Redis communication w/o testing, because # that's job of django-sse package - and focus on testing # browsers with EventSource support. # for message in testutil.MESSAGES: self.sse.add_message("message", message) testutil.MESSAGES = [] return [1] return RedisQueueView.iterator(self)