From dc7e2669ce22e977fa0d835248d184d7c3d8c1b3 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Mon, 29 Jun 2015 21:19:40 +0200 Subject: [PATCH] Added a unit test for hidden fields (should have a 'hidden' CSS class). --- test/test.py | 4 ++++ test/test_webapp.json | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/test/test.py b/test/test.py index d9a01e3..108fdc6 100644 --- a/test/test.py +++ b/test/test.py @@ -322,6 +322,10 @@ class WebAppTest(unittest.TestCase): f_orig = file('static/ssh_server.png', 'rb').read() self.assertEquals(f_orig, f_served) + def testHiddenField(self): + r = requests.get('http://localhost:8002/form?form_name=hidden_field', auth=self.auth_user) + self.assertIn('class="hidden"', r.text) + class WebAppSingleTest(unittest.TestCase): """ diff --git a/test/test_webapp.json b/test/test_webapp.json index c0de57f..affc8b3 100644 --- a/test/test_webapp.json +++ b/test/test_webapp.json @@ -139,6 +139,20 @@ "type": "file" } ] + }, + { + "name": "hidden_field", + "title": "Hidden field", + "description": "Hidden field", + "script": "test.sh", + "fields": [ + { + "name": "Hidden class", + "title": "This field has a 'hidden' class.", + "type": "string", + "hidden": true + } + ] } ] }