Example #1
0
 def test_sending_errors(self):
     settings.KONG_MAIL_MANAGERS = True
     _send_error(self.site, self.test, 'Awesome stuffs')
     self.assertEqual(len(mail.outbox), 1)
     self.assertTrue('example.com' in mail.outbox[0].body)
Example #2
0
    except Exception, e:
        succeeded = False
        content = new_err.getvalue().strip() + "\n\nException:\n\n" + str(e)

    end = datetime.datetime.now()
    duration = end - now
    duration = duration.microseconds
    commands.ERR = old_err
    result = TestResult.objects.create(site=site,
                                       test=test,
                                       succeeded=succeeded,
                                       duration=duration,
                                       content=content)

    if result.notification_needed and result.failed:
        _send_error(site, test, content)
    if result.notification_needed and result.succeeded:
        _send_recovery(site, test, content)

    return succeeded


########NEW FILE########
__FILENAME__ = views
import calendar
from collections import defaultdict
import itertools

from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.views.generic import list_detail