

def testFlagSignals(self):
    'Test signals emitted by the comment flag view'

    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])

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/comment_tests/tests/moderation_view_tests.py FlagViewTests.testFlagSignals/original