diff options
Diffstat (limited to 'desktop/tests/gui_base_test.py')
-rw-r--r-- | desktop/tests/gui_base_test.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/tests/gui_base_test.py b/desktop/tests/gui_base_test.py index 3a38ff8e..acaa9739 100644 --- a/desktop/tests/gui_base_test.py +++ b/desktop/tests/gui_base_test.py @@ -465,6 +465,20 @@ class GuiBaseTest(unittest.TestCase): # We should have timed out now self.assertEqual(tab.get_mode().server_status.status, 0) + def hit_405(self, url, expected_resp, data = {}, methods = [] ): + """Test various HTTP methods and the response""" + for method in methods: + if method == "put": + r = requests.put(url, data = data) + if method == "post": + r = requests.post(url, data = data) + if method == "delete": + r = requests.delete(url) + if method == "options": + r = requests.options(url) + self.assertTrue(expected_resp in r.text) + self.assertFalse('Werkzeug' in r.headers) + # Grouped tests follow from here def run_all_common_setup_tests(self): |