Skip to content

Conversation

JohaJung
Copy link
Contributor

@JohaJung JohaJung commented Jun 4, 2025

BeatifulSoup considers inputs as equal if they have the same HTML representation. This broke checks like tag in list_of_tags in an unexpected way.

In cases like

        <form method="POST" id="outer_inputs_form">
            <input name="bar" type="text" value="bar">
        </form>
        <!-- this input is equal (in the sense beautifulSoup checks equality)
             to that in outer_inputs_form -->
        <input name="bar" type="text" value="bar">

webtest v3.0.5 consideres the outer bar input belonging to outer_inputs_form.

I'm sorry that I overlooked that in #267 .

Now, I added a test which reveals this bug, and fixed the input field discovery (which I adjusted in #267 and thereby introduced that bug).

@gawel not sure how severe that bug is, but it has the potential to break stuff if webtest is used on pages with multiple forms on one page.

BeatifulSoup considers inputs as equal if they have the same HTML
representation. This broke checks like `tag in list_of_tags` in an
unexpected way.
@gawel gawel merged commit ea0ee86 into Pylons:main Jun 4, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants