示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    def test_delete_removes_auth_client(self, auth_client, pyramid_request):
        pyramid_request.db.delete = create_autospec(pyramid_request.db.delete,
                                                    return_value=None)
        controller = AuthClientEditController(sentinel.context,
                                              pyramid_request)

        controller.delete()

        pyramid_request.db.delete.assert_called_with(auth_client)
示例#4
0
    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)
示例#5
0
    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)