Index: cms/tests/dynamic_tests/test_dynamic.py |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/cms/tests/dynamic_tests/test_dynamic.py |
@@ -0,0 +1,20 @@ |
+import urllib2 |
+import os |
+ |
+ |
+class TestDynamic: |
+ @classmethod |
+ def run_test_server(cls): |
+ import subprocess |
+ import sys |
+ sys.path.insert(0, '../') |
+ return subprocess.Popen( |
+ ['python', 'runserver.py', 'cms/tests/test_site'] |
+ ) |
+ |
+ def test_template(self, get_pages): |
+ for page in get_pages: |
+ url = 'http://localhost:5000/root/{}'\ |
Vasily Kuznetsov
2016/07/01 14:26:15
This code would be encapsulated in the `get_page`
Jon Sonesen
2016/07/01 15:58:13
Will do.
|
+ .format(os.path.splitext(page)) |
Sebastian Noack
2016/07/01 14:56:23
I wonder whether this code behaves as intended sin
Jon Sonesen
2016/07/01 15:58:13
the test server does return 200, and the page cont
|
+ response = urllib2.urlopen(url) |
+ assert response.code == 200 |