Exemple #1
0
 def setUp(self):
     self.html = '''
         <form>
             <input name="vocals" />
             <input name="guitar" type="file" />
             <select name="drums">
                 <option value="roger">Roger<br />
                 <option value="john">John<br />
             </select>
             <input type="radio" name="bass" value="Roger">Roger<br />
             <input type="radio" name="bass" value="John">John<br />
         </form>
     '''
     self.form = Form(self.html)
Exemple #2
0
 def setUp(self):
     self.html = '''
         <form>
             <input name="vocals" />
             <input name="guitar" type="file" />
             <select name="drums">
                 <option value="roger">Roger<br />
                 <option value="john">John<br />
             </select>
             <input type="radio" name="bass" value="Roger">Roger<br />
             <input type="radio" name="bass" value="John">John<br />
         </form>
     '''
     self.form = Form(self.html)
Exemple #3
0
class TestForm(unittest.TestCase):
    def setUp(self):
        self.html = '''
            <form>
                <input name="vocals" />
                <input name="guitar" type="file" />
                <select name="drums">
                    <option value="roger">Roger<br />
                    <option value="john">John<br />
                </select>
                <input type="radio" name="bass" value="Roger">Roger<br />
                <input type="radio" name="bass" value="John">John<br />
            </form>
        '''
        self.form = Form(self.html)

    def test_fields(self):
        keys = set(('vocals', 'guitar', 'drums', 'bass'))
        assert_equal(set(self.form.fields.keys()), keys)
        assert_equal(set(self.form.keys()), keys)
Exemple #4
0
class TestForm(unittest.TestCase):

    def setUp(self):
        self.html = '''
            <form>
                <input name="vocals" />
                <input name="guitar" type="file" />
                <select name="drums">
                    <option value="roger">Roger<br />
                    <option value="john">John<br />
                </select>
                <input type="radio" name="bass" value="Roger">Roger<br />
                <input type="radio" name="bass" value="John">John<br />
            </form>
        '''
        self.form = Form(self.html)

    def test_fields(self):
        keys = set(('vocals', 'guitar', 'drums', 'bass'))
        assert_equal(set(self.form.fields.keys()), keys)
        assert_equal(set(self.form.keys()), keys)
Exemple #5
0
 def setUp(self):
     self.form = Form('<form></form>')