def testCommentSignals(self):

        # callback
        def receive(sender, **kwargs):
            self.assertEqual(kwargs['comment'].comment, "This is my comment")
            self.assert_('request' in kwargs)
            received_signals.append(kwargs.get('signal'))

        # Connect signals and keep track of handled ones
        received_signals = []
        excepted_signals = [signals.comment_will_be_posted, signals.comment_was_posted]
        for signal in excepted_signals:
            signal.connect(receive)

        # Post a comment and check the signals
        self.testCreateValidComment()
        self.assertEqual(received_signals, excepted_signals)
Test signals emitted by the comment posting view
dataset/ETHPy150Open dcramer/django-compositepks/tests/regressiontests/comment_tests/tests/comment_view_tests.py/CommentViewTests.testCommentSignals