Skip to content

Commit

Permalink
Fixing test to check for file input types first
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogenesAnalytics committed Mar 16, 2024
1 parent fd740dc commit 4b947c1
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/test_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,19 @@ def test_file_uploads_enabled(
# open initial site
sb.open(live_session_web_app_url)

# get form
form_element = sb.get_element("form")
# check for any input file types
file_inputs = sb.find_elements("input[type='file']")

# get the enctype attribute
enctype_value = form_element.get_attribute("enctype")
# only if inputs found
if file_inputs:
# get form
form_element = sb.get_element("form")

# make sure it's multipart
assert enctype_value == "multipart/form-data"
# get the enctype attribute
enctype_value = form_element.get_attribute("enctype")

# make sure it's multipart
assert enctype_value == "multipart/form-data"


@pytest.mark.website
Expand Down

0 comments on commit 4b947c1

Please sign in to comment.