diff options
Diffstat (limited to 'docs/tutorials/wiki/src/tests')
| -rw-r--r-- | docs/tutorials/wiki/src/tests/development.ini | 28 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/tests/production.ini | 17 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/tests/setup.py | 9 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/tests/tutorial/__init__.py | 3 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/tests/tutorial/templates/mytemplate.pt | 6 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/tests/tutorial/tests.py | 3 | ||||
| -rw-r--r-- | docs/tutorials/wiki/src/tests/tutorial/views.py | 10 |
7 files changed, 54 insertions, 22 deletions
diff --git a/docs/tutorials/wiki/src/tests/development.ini b/docs/tutorials/wiki/src/tests/development.ini index 996caa741..72bd22e54 100644 --- a/docs/tutorials/wiki/src/tests/development.ini +++ b/docs/tutorials/wiki/src/tests/development.ini @@ -1,5 +1,11 @@ +### +# app configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +### + [app:main] use = egg:tutorial + pyramid.reload_templates = true pyramid.debug_authorization = false pyramid.debug_notfound = false @@ -13,15 +19,26 @@ pyramid.includes = tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 +# By default, the toolbar only appears for clients from IP addresses +# '127.0.0.1' and '::1'. +# debugtoolbar.hosts = 127.0.0.1 ::1 + +### +# wsgi server configuration +### + [server:main] use = egg:waitress#main host = 0.0.0.0 port = 6543 -# Begin logging configuration +### +# logging configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +### [loggers] -keys = root +keys = root, tutorial [handlers] keys = console @@ -33,6 +50,11 @@ keys = generic level = INFO handlers = console +[logger_tutorial] +level = DEBUG +handlers = +qualname = tutorial + [handler_console] class = StreamHandler args = (sys.stderr,) @@ -41,5 +63,3 @@ formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - -# End logging configuration diff --git a/docs/tutorials/wiki/src/tests/production.ini b/docs/tutorials/wiki/src/tests/production.ini index ca8107802..d9bf27c42 100644 --- a/docs/tutorials/wiki/src/tests/production.ini +++ b/docs/tutorials/wiki/src/tests/production.ini @@ -1,5 +1,11 @@ +### +# app configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html +### + [app:main] use = egg:tutorial + pyramid.reload_templates = false pyramid.debug_authorization = false pyramid.debug_notfound = false @@ -12,12 +18,19 @@ pyramid.includes = tm.attempts = 3 zodbconn.uri = file://%(here)s/Data.fs?connection_cache_size=20000 +### +# wsgi server configuration +### + [server:main] use = egg:waitress#main host = 0.0.0.0 port = 6543 -# Begin logging configuration +### +# logging configuration +# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html +### [loggers] keys = root, tutorial @@ -45,5 +58,3 @@ formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s - -# End logging configuration diff --git a/docs/tutorials/wiki/src/tests/setup.py b/docs/tutorials/wiki/src/tests/setup.py index a7ad7317c..702d34c4c 100644 --- a/docs/tutorials/wiki/src/tests/setup.py +++ b/docs/tutorials/wiki/src/tests/setup.py @@ -9,6 +9,7 @@ CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [ 'pyramid', 'pyramid_zodbconn', + 'transaction', 'pyramid_tm', 'pyramid_debugtoolbar', 'ZODB3', @@ -20,11 +21,10 @@ requires = [ setup(name='tutorial', version='0.0', description='tutorial', - long_description=README + '\n\n' + CHANGES, + long_description=README + '\n\n' + CHANGES, classifiers=[ - "Intended Audience :: Developers", - "Framework :: Pylons", "Programming Language :: Python", + "Framework :: Pyramid", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", ], @@ -38,9 +38,8 @@ setup(name='tutorial', install_requires=requires, tests_require=requires, test_suite="tutorial", - entry_points = """\ + entry_points="""\ [paste.app_factory] main = tutorial:main """, ) - diff --git a/docs/tutorials/wiki/src/tests/tutorial/__init__.py b/docs/tutorials/wiki/src/tests/tutorial/__init__.py index b42e01d03..8ea8f8fa3 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/__init__.py +++ b/docs/tutorials/wiki/src/tests/tutorial/__init__.py @@ -11,8 +11,9 @@ def root_factory(request): conn = get_connection(request) return appmaker(conn.root()) + def main(global_config, **settings): - """ This function returns a WSGI application. + """ This function returns a Pyramid WSGI application. """ authn_policy = AuthTktAuthenticationPolicy( 'sosecret', callback=groupfinder, hashalg='sha512') diff --git a/docs/tutorials/wiki/src/tests/tutorial/templates/mytemplate.pt b/docs/tutorials/wiki/src/tests/tutorial/templates/mytemplate.pt index 3597c679b..84824f605 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/templates/mytemplate.pt +++ b/docs/tutorials/wiki/src/tests/tutorial/templates/mytemplate.pt @@ -6,9 +6,9 @@ <meta name="keywords" content="python web application" /> <meta name="description" content="pyramid web application" /> <link rel="shortcut icon" href="/static/favicon.ico" /> + <link rel="stylesheet" href="/static/pylons.css" type="text/css" media="screen" charset="utf-8" /> <link rel="stylesheet" href="http://static.pylonsproject.org/fonts/nobile/stylesheet.css" media="screen" /> <link rel="stylesheet" href="http://static.pylonsproject.org/fonts/neuton/stylesheet.css" media="screen" /> - <link rel="stylesheet" href="/static/pylons.css" type="text/css" media="screen" charset="utf-8" /> <!--[if lte IE 6]> <link rel="stylesheet" href="/static/ie6.css" type="text/css" media="screen" charset="utf-8" /> <![endif]--> @@ -41,7 +41,7 @@ <h2>Pyramid links</h2> <ul class="links"> <li> - <a href="http://pylonsproject.org">Pylons Website</a> + <a href="http://pylonsproject.org/">Pylons Website</a> </li> <li> <a href="http://docs.pylonsproject.org/projects/pyramid/current/#narrative-documentation">Narrative Documentation</a> @@ -70,7 +70,7 @@ </div> </div> <div id="footer"> - <div class="footer">© Copyright 2008-2011, Agendaless Consulting.</div> + <div class="footer">© Copyright 2008-2012, Agendaless Consulting.</div> </div> </body> </html> diff --git a/docs/tutorials/wiki/src/tests/tutorial/tests.py b/docs/tutorials/wiki/src/tests/tutorial/tests.py index 81f7a1882..c435a4519 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/tests.py +++ b/docs/tutorials/wiki/src/tests/tutorial/tests.py @@ -30,6 +30,7 @@ class WikiModelTests(unittest.TestCase): self.assertEqual(wiki.__name__, None) class AppmakerTests(unittest.TestCase): + def _callFUT(self, zodb_root): from .models import appmaker return appmaker(zodb_root) @@ -142,7 +143,7 @@ class FunctionalTests(unittest.TestCase): 'pyramid.includes': ['pyramid_zodbconn', 'pyramid_tm'] } app = main({}, **settings) - self.db = app.registry.zodb_database + self.db = app.registry._zodb_databases[''] from webtest import TestApp self.testapp = TestApp(app) diff --git a/docs/tutorials/wiki/src/tests/tutorial/views.py b/docs/tutorials/wiki/src/tests/tutorial/views.py index 50485d279..77956b1e3 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/views.py +++ b/docs/tutorials/wiki/src/tests/tutorial/views.py @@ -64,8 +64,8 @@ def add_page(context, request): page.__name__ = pagename page.__parent__ = context - return dict(page = page, save_url = save_url, - logged_in = authenticated_userid(request)) + return dict(page=page, save_url=save_url, + logged_in=authenticated_userid(request)) @view_config(name='edit_page', context='.models.Page', renderer='templates/edit.pt', @@ -75,9 +75,9 @@ def edit_page(context, request): context.data = request.params['body'] return HTTPFound(location = request.resource_url(context)) - return dict(page = context, - save_url = request.resource_url(context, 'edit_page'), - logged_in = authenticated_userid(request)) + return dict(page=context, + save_url=request.resource_url(context, 'edit_page'), + logged_in=authenticated_userid(request)) @view_config(context='.models.Wiki', name='login', renderer='templates/login.pt') |
