예제 #1
0
 def test_500_in_ckan(self):
     environ = {'PATH_INFO': 'about',
                'REQUEST_METHOD': 'GET'}
     wp_status, wp_content = middleware.get_wordpress_content(
         environ,
         'about')
     repl = middleware.replace_relevant_bits("some_error",
                                             wp_content,
                                             "500 oops",
                                             wp_status)
     assert repl == "some_error", repl
예제 #2
0
 def test_no_nav_in_ckan(self):
     environ = {'PATH_INFO': 'about',
                'REQUEST_METHOD': 'GET'}
     wp_status, wp_content = middleware.get_wordpress_content(
         environ,
         'about')
     repl = middleware.replace_relevant_bits("not much",
                                             wp_content,
                                             "200 OK",
                                             wp_status)
     assert repl == "<p>not much</p>", repl