Skip to content

Instantly share code, notes, and snippets.

Created April 13, 2015 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/d2e22dce9b21aead4c3c to your computer and use it in GitHub Desktop.
Save anonymous/d2e22dce9b21aead4c3c to your computer and use it in GitHub Desktop.
from django.core.urlresolvers import reverse
from django import http
from django.utils.six.moves.urllib.parse import urlsplit # noqa
from mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
INDEX_URL = reverse('horizon:settings:api_keys:index')
class ApiKeyTests(test.TestCase):
"""We might have to create a setUp() where we create the default panel
as for some reason it isn't created when this test runs. Could also be
that our API Key Panel isn't doing the right thing but that seems less
likely.
"""
@test.create_stubs({api.keystone: ('user_update', )})
def test_change_password(self):
api.keystone.user_update(IsA(http.HttpRequest),
'normalpwd',).AndReturn(None)
self.mox.ReplayAll()
formData = {'method': 'ResetAPIKeyForm'}
res = self.client.post(INDEX_URL, formData)
self.assertNoFormErrors(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment