def ticket_admin_util(model_admin_util): model_admin_util.model_admin = admin.TicketAdmin(Ticket, AdminSite()) model_admin_util.model_admin.message_user = Mock(name='message_user') model_admin_util.model_admin.get_request_helpdeskuser = (Mock( name='get_request_helpdeskuser', return_value=model_admin_util.user)) model_admin_util.obj = Mock(spec=Ticket) return model_admin_util
def setUp(self): self.ticket_admin = admin.TicketAdmin(Ticket, AdminSite()) self.fake_pk = 1