Esempio n. 1
0
def create_ticket(summary, custom_fields):
    ticket = Ticket(app_config_id=c.app.config._id,
                    ticket_num=1,
                    summary=summary,
                    custom_fields=custom_fields)
    session(ticket).flush()
    return ticket
Esempio n. 2
0
def create_ticket(summary, custom_fields):
    ticket = Ticket(app_config_id=c.app.config._id,
                    ticket_num=1,
                    summary=summary,
                    custom_fields=custom_fields)
    session(ticket).flush()
    return ticket
Esempio n. 3
0
def create_colors_are_wrong_ticket():
    set_tracker_custom_fields([dict(name='_iteration_number',
                                    label='Iteration Number',
                                    show_in_search=True)])
    ticket = create_ticket(summary="colors are wrong",
                           custom_fields=dict(_iteration_number='Iteration 1'))
    ticket.commit()
    session(ticket).flush()
    return ticket
Esempio n. 4
0
def create_colors_are_wrong_ticket():
    set_tracker_custom_fields([dict(name='_iteration_number',
                                    label='Iteration Number',
                                    type='number',
                                    show_in_search=True)])
    ticket = create_ticket(summary="colors are wrong",
                           custom_fields=dict(_iteration_number='Iteration 1'))
    ticket.commit()
    session(ticket).flush()
    return ticket
Esempio n. 5
0
 def test_disabled_user(self):
     user = M.User.query.get(username='******')
     sess = session(user)
     assert not user.disabled
     r = self.app.get('/p/test/admin/', extra_environ={'username':'******'})
     assert_equal(r.status_int, 200, 'Redirect to %s' % r.location)
     user.disabled = True
     sess.save(user)
     sess.flush()
     user = M.User.query.get(username='******')
     assert user.disabled
     r = self.app.get('/p/test/admin/', extra_environ={'username':'******'})
     assert_equal(r.status_int, 302)
     assert_equal(r.location, 'http://localhost/auth/?return_to=%2Fp%2Ftest%2Fadmin%2F')
Esempio n. 6
0
 def test_disabled_user(self):
     user = M.User.query.get(username='******')
     sess = session(user)
     assert not user.disabled
     r = self.app.get('/p/test/admin/',
                      extra_environ={'username': '******'})
     assert_equal(r.status_int, 200, 'Redirect to %s' % r.location)
     user.disabled = True
     sess.save(user)
     sess.flush()
     user = M.User.query.get(username='******')
     assert user.disabled
     r = self.app.get('/p/test/admin/',
                      extra_environ={'username': '******'})
     assert_equal(r.status_int, 302)
     assert_equal(
         r.location,
         'http://localhost/auth/?return_to=%2Fp%2Ftest%2Fadmin%2F')
Esempio n. 7
0
def set_tracker_custom_fields(custom_fields):
    c.app.globals.custom_fields = custom_fields
    session(c.app.globals).flush()
Esempio n. 8
0
def set_tracker_custom_fields(custom_fields):
    c.app.globals.custom_fields = custom_fields
    session(c.app.globals).flush()