func (s *FilterSuite) APILogin(c *gc.C, unit *state.Unit) { password, err := utils.RandomPassword() c.Assert(err, gc.IsNil) err = unit.SetPassword(password) c.Assert(err, gc.IsNil) s.st = s.OpenAPIAs(c, unit.Tag(), password) s.uniter = s.st.Uniter() c.Assert(s.uniter, gc.NotNil) }