From 34e974e360184baef873da55f31379697e367f32 Mon Sep 17 00:00:00 2001 From: Paul Everitt Date: Wed, 25 Sep 2013 12:08:33 -0400 Subject: Get pyramid_chameleon added to the quick tutorial, plus some other fixes for Python 3. --- docs/quick_tutorial/authentication/setup.py | 1 + .../authentication/tutorial/__init__.py | 1 + .../authentication/tutorial/tests.py | 47 ---------------------- 3 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 docs/quick_tutorial/authentication/tutorial/tests.py (limited to 'docs/quick_tutorial/authentication') diff --git a/docs/quick_tutorial/authentication/setup.py b/docs/quick_tutorial/authentication/setup.py index 9997984d3..2221b72e9 100644 --- a/docs/quick_tutorial/authentication/setup.py +++ b/docs/quick_tutorial/authentication/setup.py @@ -2,6 +2,7 @@ from setuptools import setup requires = [ 'pyramid', + 'pyramid_chameleon' ] setup(name='tutorial', diff --git a/docs/quick_tutorial/authentication/tutorial/__init__.py b/docs/quick_tutorial/authentication/tutorial/__init__.py index 7aa049427..efc09e760 100644 --- a/docs/quick_tutorial/authentication/tutorial/__init__.py +++ b/docs/quick_tutorial/authentication/tutorial/__init__.py @@ -7,6 +7,7 @@ from .security import groupfinder def main(global_config, **settings): config = Configurator(settings=settings) + config.include('pyramid_chameleon') # Security policies authn_policy = AuthTktAuthenticationPolicy( diff --git a/docs/quick_tutorial/authentication/tutorial/tests.py b/docs/quick_tutorial/authentication/tutorial/tests.py deleted file mode 100644 index 6ff554a1e..000000000 --- a/docs/quick_tutorial/authentication/tutorial/tests.py +++ /dev/null @@ -1,47 +0,0 @@ -import unittest - -from pyramid import testing - - -class TutorialViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_home(self): - from .views import TutorialViews - - request = testing.DummyRequest() - inst = TutorialViews(request) - response = inst.home() - self.assertEqual('Home View', response['name']) - - def test_hello(self): - from .views import TutorialViews - - request = testing.DummyRequest() - inst = TutorialViews(request) - response = inst.hello() - self.assertEqual('Hello View', response['name']) - - -class TutorialFunctionalTests(unittest.TestCase): - def setUp(self): - from tutorial import main - app = main({}) - from webtest import TestApp - - self.testapp = TestApp(app) - - def tearDown(self): - testing.tearDown() - - def test_home(self): - res = self.testapp.get('/', status=200) - self.assertIn(b'

Hi Home View', res.body) - - def test_hello(self): - res = self.testapp.get('/howdy', status=200) - self.assertIn(b'

Hi Hello View', res.body) -- cgit v1.2.3