summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/forms
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/forms
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/forms')
-rw-r--r--docs/quick_tutorial/forms/setup.py1
-rw-r--r--docs/quick_tutorial/forms/tutorial/__init__.py1
-rw-r--r--docs/quick_tutorial/forms/tutorial/tests.py23
3 files changed, 8 insertions, 17 deletions
diff --git a/docs/quick_tutorial/forms/setup.py b/docs/quick_tutorial/forms/setup.py
index 5db620eb9..361ade013 100644
--- a/docs/quick_tutorial/forms/setup.py
+++ b/docs/quick_tutorial/forms/setup.py
@@ -2,6 +2,7 @@ from setuptools import setup
requires = [
'pyramid',
+ 'pyramid_chameleon',
'deform'
]
diff --git a/docs/quick_tutorial/forms/tutorial/__init__.py b/docs/quick_tutorial/forms/tutorial/__init__.py
index b12a4154a..dff7457cf 100644
--- a/docs/quick_tutorial/forms/tutorial/__init__.py
+++ b/docs/quick_tutorial/forms/tutorial/__init__.py
@@ -3,6 +3,7 @@ from pyramid.config import Configurator
def main(global_config, **settings):
config = Configurator(settings=settings)
+ config.include('pyramid_chameleon')
config.add_route('wiki_view', '/')
config.add_route('wikipage_add', '/add')
config.add_route('wikipage_view', '/{uid}')
diff --git a/docs/quick_tutorial/forms/tutorial/tests.py b/docs/quick_tutorial/forms/tutorial/tests.py
index 6ff554a1e..5a2c40904 100644
--- a/docs/quick_tutorial/forms/tutorial/tests.py
+++ b/docs/quick_tutorial/forms/tutorial/tests.py
@@ -11,25 +11,18 @@ class TutorialViewTests(unittest.TestCase):
testing.tearDown()
def test_home(self):
- from .views import TutorialViews
+ from .views import WikiViews
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'])
+ inst = WikiViews(request)
+ response = inst.wiki_view()
+ self.assertEqual(len(response['pages']), 3)
class TutorialFunctionalTests(unittest.TestCase):
def setUp(self):
from tutorial import main
+
app = main({})
from webtest import TestApp
@@ -40,8 +33,4 @@ class TutorialFunctionalTests(unittest.TestCase):
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)
+ self.assertIn(b'<title>Wiki: View</title>', res.body)