'Test signals emitted by the comment flag view'

def testFlagSignals(self):

    def receive(sender, **kwargs):
        self.assertEqual(kwargs['flag'].flag, CommentFlag.SUGGEST_REMOVAL)
        self.assertEqual(kwargs['request'].user.username, 'normaluser')
        received_signals.append(kwargs.get('signal'))
    received_signals = []
    signals.comment_was_flagged.connect(receive)
    self.testFlagPost()
    self.assertEqual(received_signals, [signals.comment_was_flagged])
