def test_create_container_post(self): formData = {'name': 'containerName', 'method': 'CreateContainer'} self.mox.StubOutWithMock(api, 'chase_create_container') api.chase_create_container(IsA(http.HttpRequest), u'containerName') self.mox.ReplayAll() res = self.client.post(reverse('steer:engine:containers:create'), formData) self.assertRedirectsNoFollow(res, CONTAINER_INDEX_URL)
def test_create_container_post(self): formData = {'name': 'containerName', 'method': 'CreateContainer'} self.mox.StubOutWithMock(api, 'chase_create_container') api.chase_create_container( IsA(http.HttpRequest), u'containerName') self.mox.ReplayAll() res = self.client.post(reverse('steer:engine:containers:create'), formData) self.assertRedirectsNoFollow(res, CONTAINER_INDEX_URL)
def handle(self, request, data): api.chase_create_container(request, data['name']) messages.success(request, _("Container was successfully created.")) return shortcuts.redirect("steer:engine:containers:index")