Ejemplo n.º 1
0
class StatusTest(TestCase):

    def setUp(self):

        NotificationsBin.clear()

        sla = SLA.objects.create(name="RoadMap",
                                 start_date="2012-01-01",
                                 end_date="2012-12-31")
        
        service =sla.service_set.create(response_time=2,
                                        solution_time=4,
                                        priority="normal")

        contact = Contact.objects.create(email="*****@*****.**")
        contact.save()
        contact.sla.add(sla)

        self.issue = Issue(title="broken stuff",
                           contact=contact,
                           service=service,
                           text="Well, it's broken",
                           created=datetime.now(),
                           sla=sla)

        self.issue.save()


    def test_notify(self):

        status = Status.objects.create(
            name=settings.ISSUE_STATUS_CLOSED,
            issue=self.issue,
            comment="Closed!")

        status.save()

        try:
            notification = NotificationsBin.receive()
        except:
            self.fail("We should have mail!")
Ejemplo n.º 2
0
class StatusTest(TestCase):
    def setUp(self):

        NotificationsBin.clear()

        sla = SLA.objects.create(name="RoadMap",
                                 start_date="2012-01-01",
                                 end_date="2012-12-31")

        service = sla.service_set.create(response_time=2,
                                         solution_time=4,
                                         priority="normal")

        contact = Contact.objects.create(email="*****@*****.**")
        contact.save()
        contact.sla.add(sla)

        self.issue = Issue(title="broken stuff",
                           contact=contact,
                           service=service,
                           text="Well, it's broken",
                           created=datetime.now(),
                           sla=sla)

        self.issue.save()

    def test_notify(self):

        status = Status.objects.create(name=settings.ISSUE_STATUS_CLOSED,
                                       issue=self.issue,
                                       comment="Closed!")

        status.save()

        try:
            notification = NotificationsBin.receive()
        except:
            self.fail("We should have mail!")
Ejemplo n.º 3
0
    def setUp(self):

        NotificationsBin.clear()

        sla = SLA.objects.create(name="RoadMap",
                                 start_date="2012-01-01",
                                 end_date="2012-12-31")

        service = sla.service_set.create(response_time=2,
                                         solution_time=4,
                                         priority="normal")

        contact = Contact.objects.create(email="*****@*****.**")
        contact.save()
        contact.sla.add(sla)

        self.issue = Issue(title="broken stuff",
                           contact=contact,
                           service=service,
                           text="Well, it's broken",
                           created=datetime.now(),
                           sla=sla)

        self.issue.save()
Ejemplo n.º 4
0
    def setUp(self):

        NotificationsBin.clear()

        sla = SLA.objects.create(name="RoadMap",
                                 start_date="2012-01-01",
                                 end_date="2012-12-31")
        
        service =sla.service_set.create(response_time=2,
                                        solution_time=4,
                                        priority="normal")

        contact = Contact.objects.create(email="*****@*****.**")
        contact.save()
        contact.sla.add(sla)

        self.issue = Issue(title="broken stuff",
                           contact=contact,
                           service=service,
                           text="Well, it's broken",
                           created=datetime.now(),
                           sla=sla)

        self.issue.save()