コード例 #1
0
ファイル: test_utils.py プロジェクト: shu777/django-dbbackup
    def test_raise_error_without_mail(self):
        def func():
            raise Exception('Foo')

        with self.assertRaises(Exception):
            utils.email_uncaught_exception(func)()
        self.assertEqual(len(mail.outbox), 0)
コード例 #2
0
ファイル: test_utils.py プロジェクト: underyx/django-dbbackup
    def test_raise_with_mail(self):
        def func():
            raise Exception("Foo")

        with self.assertRaises(Exception):
            utils.email_uncaught_exception(func)()
        self.assertEqual(len(mail.outbox), 1)
コード例 #3
0
ファイル: test_utils.py プロジェクト: ZuluPro/django-dbbackup
 def test_raise_with_mail(self):
     def func():
         raise Exception('Foo')
     with self.assertRaises(Exception):
         utils.email_uncaught_exception(func)()
     self.assertEqual(len(mail.outbox), 1)
     error_mail = mail.outbox[0]
     self.assertEqual(['foo@bar'], error_mail.to)
     self.assertIn("Exception('Foo')", error_mail.subject)
     if django.VERSION >= (1, 7):
         self.assertIn("Exception('Foo')", error_mail.body)
コード例 #4
0
 def test_raise_with_mail(self):
     def func():
         raise Exception('Foo')
     with self.assertRaises(Exception):
         utils.email_uncaught_exception(func)()
     self.assertEqual(len(mail.outbox), 1)
     error_mail = mail.outbox[0]
     self.assertEqual(['foo@bar'], error_mail.to)
     self.assertIn("Exception('Foo')", error_mail.subject)
     if django.VERSION >= (1, 7):
         self.assertIn("Exception('Foo')", error_mail.body)
コード例 #5
0
 def test_success(self):
     def func():
         pass
     utils.email_uncaught_exception(func)
コード例 #6
0
ファイル: test_utils.py プロジェクト: shu777/django-dbbackup
    def test_success(self):
        def func():
            pass

        utils.email_uncaught_exception(func)
        self.assertEqual(len(mail.outbox), 0)
コード例 #7
0
 def test_success(self):
     def func():
         pass
     utils.email_uncaught_exception(func)
コード例 #8
0
ファイル: test_utils.py プロジェクト: ZuluPro/django-dbbackup
 def test_raise_error_without_mail(self):
     def func():
         raise Exception('Foo')
     with self.assertRaises(Exception):
         utils.email_uncaught_exception(func)()
     self.assertEqual(len(mail.outbox), 0)
コード例 #9
0
ファイル: test_utils.py プロジェクト: ZuluPro/django-dbbackup
 def test_success(self):
     def func():
         pass
     utils.email_uncaught_exception(func)
     self.assertEqual(len(mail.outbox), 0)