Beispiel #1
0
    def test_delete_removes_authclient(self, authclient, pyramid_request):
        pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None)
        ctrl = AuthClientEditController(authclient, pyramid_request)

        ctrl.delete()

        pyramid_request.db.delete.assert_called_with(authclient)
    def test_delete_removes_authclient(self, authclient, matchers, pyramid_request):
        pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None)
        ctrl = AuthClientEditController(authclient, pyramid_request)

        ctrl.delete()

        pyramid_request.db.delete.assert_called_with(authclient)
Beispiel #3
0
    def test_delete_redirects_to_index(self, authclient, pyramid_request):
        pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None)
        ctrl = AuthClientEditController(authclient, pyramid_request)

        response = ctrl.delete()

        expected_location = pyramid_request.route_url('admin_oauthclients')
        assert response == redirect_302_to(expected_location)
    def test_delete_redirects_to_index(self, authclient, matchers, pyramid_request):
        pyramid_request.db.delete = create_autospec(pyramid_request.db.delete, return_value=None)
        ctrl = AuthClientEditController(authclient, pyramid_request)

        response = ctrl.delete()

        expected_location = pyramid_request.route_url('admin_oauthclients')
        assert response == matchers.Redirect302To(expected_location)