Created
November 6, 2011 01:56
-
-
Save flavianmissi/1342352 to your computer and use it in GitHub Desktop.
Testing Django signals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
from my_app.signals import foo_bar | |
class SignalsTestCase(TestCase): | |
def dummy_listener(self, sender, **kwargs): | |
self.times += 1 | |
def test_deve_chamar_o_signal_foo_bar(self): | |
self.times = 0 | |
foo_bar.connect(self.dummy_listener) | |
metodo_que_deve_disparar_o_sinal() | |
self.asserGreater(self.times, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment