def METHOD_NAME(self):
    url = reverse('ci:gitlab:sign_in', args=[self.server.name])
    response = self.client.get(url)
    self.assertIn(self.oauth._state_key, self.client.session)
    state = self.client.session[self.oauth._state_key]
    self.assertIn(state, response.url)
    self.assertIn('state=', response.url)
    self.assertIn('scope=api', response.url)
    # already signed in
    response = self.client.get(url)
    self.assertEqual(response.status_code, 302) # redirect
    session = self.client.session
    session[self.oauth._token_key] = {'access_token': '1234', 'token_type': 'bearer', 'scope': 'api'}
    session.save()
    response = self.client.get(url)
    self.assertEqual(response.status_code, 302) # redirect