Skip to content

Commit

Permalink
Merge pull request #6292 from 4teamwork/lg-more-smoketests
Browse files Browse the repository at this point in the history
Smoketests: Test that POST requests never get answered with index.html.
  • Loading branch information
lukasgraf authored Mar 3, 2020
2 parents be2da2f + ae5d428 commit e42b0bf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions rewrite_rule_smoketests/smoketests.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@ def test_gever_front_page_logged_in_old_ui(browser, admin_unit):
assert_equal(admin_unit.url, logo.attrib['href'])


@on_admin_unit
def test_anonymous_post_requests_always_hit_gever(browser, admin_unit):
"""This is a regression test for a case, where simple POST requests got
answered with the new frontend's index.html.
"""
target_url = '/'.join((admin_unit.front_page_url, 'doesnt-exist'))

browser.raise_http_errors = False
browser.open(target_url, method='POST')

assert_equal(404, browser.status_code)

# Assert we hit Plone by checking for the presence of the logo
assert_equal(1, len(browser.css('#portal-logo')))


def main():
prompt_credentials = False
if '--prompt-credentials' in sys.argv:
Expand Down

0 comments on commit e42b0bf

Please sign in to comment.