예제 #1
0
파일: roadmap.py 프로젝트: wataash/trac
    def setUp(self):
        self.env = EnvironmentStub(default_data=True)

        self.milestone1 = Milestone(self.env)
        self.milestone1.name = 'Test'
        self.milestone1.insert()
        self.milestone2 = Milestone(self.env)
        self.milestone2.name = 'Test2'
        self.milestone2.insert()

        tkt1 = insert_ticket(self.env,
                             summary='Foo',
                             milestone='Test',
                             owner='foman',
                             status='new')
        tkt2 = insert_ticket(self.env,
                             summary='Bar',
                             milestone='Test',
                             status='closed',
                             owner='barman')
        tkt3 = insert_ticket(self.env,
                             summary='Sum',
                             milestone='Test',
                             owner='suman',
                             status='reopened')
        self.tkt1 = tkt1
        self.tkt2 = tkt2
        self.tkt3 = tkt3

        prov = DefaultTicketGroupStatsProvider(ComponentManager())
        prov.env = self.env
        prov.config = self.env.config
        self.stats = prov.get_ticket_group_stats([tkt1.id, tkt2.id, tkt3.id])
예제 #2
0
파일: roadmap.py 프로젝트: khoi-huynh/trac
    def setUp(self):
        self.env = EnvironmentStub(default_data=True)

        self.milestone1 = Milestone(self.env)
        self.milestone1.name = 'Test'
        self.milestone1.insert()
        self.milestone2 = Milestone(self.env)
        self.milestone2.name = 'Test2'
        self.milestone2.insert()

        tkt1 = Ticket(self.env)
        tkt1.populate({
            'summary': 'Foo',
            'milestone': 'Test',
            'owner': 'foman',
            'status': 'new'
        })
        tkt1.insert()
        tkt2 = Ticket(self.env)
        tkt2.populate({
            'summary': 'Bar',
            'milestone': 'Test',
            'status': 'closed',
            'owner': 'barman'
        })
        tkt2.insert()
        tkt3 = Ticket(self.env)
        tkt3.populate({
            'summary': 'Sum',
            'milestone': 'Test',
            'owner': 'suman',
            'status': 'reopened'
        })
        tkt3.insert()
        self.tkt1 = tkt1
        self.tkt2 = tkt2
        self.tkt3 = tkt3

        prov = DefaultTicketGroupStatsProvider(ComponentManager())
        prov.env = self.env
        prov.config = self.env.config
        self.stats = prov.get_ticket_group_stats([tkt1.id, tkt2.id, tkt3.id])