diff options
| -rw-r--r-- | CHANGES.rst | 3 | ||||
| -rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
| -rw-r--r-- | contributing.md | 2 | ||||
| -rw-r--r-- | docs/quick_tutorial/forms.rst | 2 | ||||
| -rw-r--r-- | docs/quick_tutorial/forms/tutorial/tests.py | 30 | ||||
| -rw-r--r-- | tox.ini | 1 |
6 files changed, 38 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 4f0de298b..cf13bd6b5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -159,3 +159,6 @@ Documentation Changes https://github.com/Pylons/pyramid/pull/3271, https://github.com/Pylons/pyramid/issues/667, and https://github.com/Pylons/pyramid/issues/2572 + +- Added extra tests to the quick tutorial. + See https://github.com/Pylons/pyramid/pull/3375 diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 80b43c8ec..7256b66db 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -332,3 +332,5 @@ Contributors - Kuzma Leshakov, 2018/09/07 - Colin Dunklau, 2018/09/19 + +- Alexandre Yukio Harano, 2018/10/05 diff --git a/contributing.md b/contributing.md index 40c42add7..aa0f10761 100644 --- a/contributing.md +++ b/contributing.md @@ -51,7 +51,7 @@ System](https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.h git remote add upstream git@github.com:Pylons/pyramid.git 5. Create a virtual environment and set an environment variable as instructed in the - [prerequisites](https://github.com/Pylons/pyramid/blob/master/HACKING.txt#L55-L58). + [prerequisites](https://github.com/Pylons/pyramid/blob/master/HACKING.txt#L48-L56). # Mac and Linux $ export VENV=~/hack-on-pyramid/env diff --git a/docs/quick_tutorial/forms.rst b/docs/quick_tutorial/forms.rst index 9e427c7e2..7d759b72d 100644 --- a/docs/quick_tutorial/forms.rst +++ b/docs/quick_tutorial/forms.rst @@ -88,7 +88,7 @@ Steps $VENV/bin/pytest tutorial/tests.py -q .. - 2 passed in 0.45 seconds + 6 passed in 0.81 seconds #. Run your Pyramid application with: diff --git a/docs/quick_tutorial/forms/tutorial/tests.py b/docs/quick_tutorial/forms/tutorial/tests.py index 5a2c40904..f0e39aa38 100644 --- a/docs/quick_tutorial/forms/tutorial/tests.py +++ b/docs/quick_tutorial/forms/tutorial/tests.py @@ -34,3 +34,33 @@ class TutorialFunctionalTests(unittest.TestCase): def test_home(self): res = self.testapp.get('/', status=200) self.assertIn(b'<title>Wiki: View</title>', res.body) + + def test_add_page(self): + res = self.testapp.get('/add', status=200) + self.assertIn(b'<h1>Wiki</h1>', res.body) + + def test_edit_page(self): + res = self.testapp.get('/101/edit', status=200) + self.assertIn(b'<h1>Wiki</h1>', res.body) + + def test_post_wiki(self): + self.testapp.post('/add', { + "title": "New Title", + "body": "<p>New Body</p>", + "submit": "submit" + }, status=302) + + res = self.testapp.get('/103', status=200) + self.assertIn(b'<h1>New Title</h1>', res.body) + self.assertIn(b'<p>New Body</p>', res.body) + + def test_edit_wiki(self): + self.testapp.post('/102/edit', { + "title": "New Title", + "body": "<p>New Body</p>", + "submit": "submit" + }, status=302) + + res = self.testapp.get('/102', status=200) + self.assertIn(b'<h1>New Title</h1>', res.body) + self.assertIn(b'<p>New Body</p>', res.body) @@ -74,6 +74,7 @@ deps = check-manifest [testenv:docs] +# pin to 3.5 to match what RTD uses basepython = python3.5 whitelist_externals = make commands = |
