예제 #1
0
    def test_is_submitable(self):

        obj = SelectableInputFormElementParser()
        form_elements = obj.parse(self.TESTVALUE)

        self.assertEqual(1, len(form_elements))
        self.assertTrue(form_elements[0].is_submitable)
예제 #2
0
    def test_default_value(self):

        obj = SelectableInputFormElementParser()
        form_elements = obj.parse(self.DEFAULT_TESTVALUE)

        self.assertEqual(1, len(form_elements))
        self.assertEqual(obj._default_value, form_elements[0].value)
예제 #3
0
    def test_suitable_invalid(self):

        obj = SelectableInputFormElementParser()
        result = obj.suitable("example", "example")

        self.assertFalse(result)
예제 #4
0
    def test_suitable_radio(self):

        obj = SelectableInputFormElementParser()
        result = obj.suitable("input", "radio")

        self.assertTrue(result)
예제 #5
0
    def test_suitable_checkbox(self):

        obj = SelectableInputFormElementParser()
        result = obj.suitable("input", "checkbox")

        self.assertTrue(result)