summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/authorization
diff options
context:
space:
mode:
authorPaul Everitt <paul@agendaless.com>2013-09-25 12:08:33 -0400
committerPaul Everitt <paul@agendaless.com>2013-09-25 12:08:33 -0400
commit34e974e360184baef873da55f31379697e367f32 (patch)
treea1bfd80a83566c5b9500cd6754599e055cfbb458 /docs/quick_tutorial/authorization
parent94e72c2fe1ca6acc1dc50ab8c0da48e0e191b4df (diff)
downloadpyramid-34e974e360184baef873da55f31379697e367f32.tar.gz
pyramid-34e974e360184baef873da55f31379697e367f32.tar.bz2
pyramid-34e974e360184baef873da55f31379697e367f32.zip
Get pyramid_chameleon added to the quick tutorial, plus some other fixes for Python 3.
Diffstat (limited to 'docs/quick_tutorial/authorization')
-rw-r--r--docs/quick_tutorial/authorization/setup.py1
-rw-r--r--docs/quick_tutorial/authorization/tutorial/__init__.py1
-rw-r--r--docs/quick_tutorial/authorization/tutorial/tests.py47
3 files changed, 2 insertions, 47 deletions
diff --git a/docs/quick_tutorial/authorization/setup.py b/docs/quick_tutorial/authorization/setup.py
index 9997984d3..2221b72e9 100644
--- a/docs/quick_tutorial/authorization/setup.py
+++ b/docs/quick_tutorial/authorization/setup.py
@@ -2,6 +2,7 @@ from setuptools import setup
requires = [
'pyramid',
+ 'pyramid_chameleon'
]
setup(name='tutorial',
diff --git a/docs/quick_tutorial/authorization/tutorial/__init__.py b/docs/quick_tutorial/authorization/tutorial/__init__.py
index 715a14203..8f7ab8277 100644
--- a/docs/quick_tutorial/authorization/tutorial/__init__.py
+++ b/docs/quick_tutorial/authorization/tutorial/__init__.py
@@ -8,6 +8,7 @@ from .security import groupfinder
def main(global_config, **settings):
config = Configurator(settings=settings,
root_factory='.resources.Root')
+ config.include('pyramid_chameleon')
# Security policies
authn_policy = AuthTktAuthenticationPolicy(
diff --git a/docs/quick_tutorial/authorization/tutorial/tests.py b/docs/quick_tutorial/authorization/tutorial/tests.py
deleted file mode 100644
index 6ff554a1e..000000000
--- a/docs/quick_tutorial/authorization/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'<h1>Hi Home View', res.body)
-
- def test_hello(self):
- res = self.testapp.get('/howdy', status=200)
- self.assertIn(b'<h1>Hi Hello View', res.body)