summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2020-01-01 19:22:43 -0800
committerSteve Piercy <web@stevepiercy.com>2020-01-02 23:30:59 -0800
commitf929eace7ec1843712fb1831b834a7966330d43e (patch)
treeaaeae3577999c0c5275bf7507f9bb7b5121049de /docs
parentf2320a274a7168916aeb40cdbc094c4911e5e747 (diff)
downloadpyramid-f929eace7ec1843712fb1831b834a7966330d43e.tar.gz
pyramid-f929eace7ec1843712fb1831b834a7966330d43e.tar.bz2
pyramid-f929eace7ec1843712fb1831b834a7966330d43e.zip
Resync quick_tutorial/cookiecutters.rst and related files after moving tests directory, including tests package
Diffstat (limited to 'docs')
-rw-r--r--docs/quick_tutorial/cookiecutters/tests/__init__.py0
-rw-r--r--docs/quick_tutorial/cookiecutters/tests/test_it.py39
2 files changed, 39 insertions, 0 deletions
diff --git a/docs/quick_tutorial/cookiecutters/tests/__init__.py b/docs/quick_tutorial/cookiecutters/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/docs/quick_tutorial/cookiecutters/tests/__init__.py
diff --git a/docs/quick_tutorial/cookiecutters/tests/test_it.py b/docs/quick_tutorial/cookiecutters/tests/test_it.py
new file mode 100644
index 000000000..634abfdf2
--- /dev/null
+++ b/docs/quick_tutorial/cookiecutters/tests/test_it.py
@@ -0,0 +1,39 @@
+import unittest
+
+from pyramid import testing
+
+
+class ViewTests(unittest.TestCase):
+ def setUp(self):
+ self.config = testing.setUp()
+
+ def tearDown(self):
+ testing.tearDown()
+
+ def test_my_view(self):
+ from cc_starter.views.default import my_view
+ request = testing.DummyRequest()
+ info = my_view(request)
+ self.assertEqual(info['project'], 'cc_starter')
+
+ def test_notfound_view(self):
+ from cc_starter.views.notfound import notfound_view
+ request = testing.DummyRequest()
+ info = notfound_view(request)
+ self.assertEqual(info, {})
+
+
+class FunctionalTests(unittest.TestCase):
+ def setUp(self):
+ from cc_starter import main
+ app = main({})
+ from webtest import TestApp
+ self.testapp = TestApp(app)
+
+ def test_root(self):
+ res = self.testapp.get('/', status=200)
+ self.assertTrue(b'Pyramid' in res.body)
+
+ def test_notfound(self):
+ res = self.testapp.get('/badurl', status=404)
+ self.assertTrue(res.status_code == 404)