@override_settings(
            ADMINS=(('admin', 'admin@example.com'),),
            EMAIL_SUBJECT_PREFIX='',
            DEBUG=False,
        )
    def test_subject_accepts_newlines(self):
        """
        Ensure that newlines in email reports' subjects are escaped to avoid
        AdminErrorHandler to fail.
        Refs #17281.
        """
        message = u'Message \r\n with newlines'
        expected_subject = u'ERROR: Message \\r\\n with newlines'

        self.assertEqual(len(mail.outbox), 0)

        logger = getLogger('django.request')
        logger.error(message)

        self.assertEqual(len(mail.outbox), 1)
        self.assertFalse(mail.outbox[0].subject in '\n')
        self.assertFalse('\r' in mail.outbox[0].subject)
        self.assertEqual(mail.outbox[0].subject, expected_subject)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/tests/regressiontests/logging_tests/tests.py/AdminEmailHandlerTest.test_subject_accepts_newlines/swapped operands of `in`