|
|
|
@ -199,14 +199,20 @@ def webtest(base_app): |
|
|
|
# create the TestApp - note that specifying wsgi.url_scheme is necessary so that the |
|
|
|
# secure cookies from the session library will work |
|
|
|
app = TestApp( |
|
|
|
base_app, extra_environ={"wsgi.url_scheme": "https"}, cookiejar=CookieJar() |
|
|
|
base_app, |
|
|
|
# This "tm.active" is a temporary fix around this fixture failing to rollback |
|
|
|
# data after the tests are complete. |
|
|
|
extra_environ={"wsgi.url_scheme": "https", "tm.active": True}, |
|
|
|
cookiejar=CookieJar(), |
|
|
|
) |
|
|
|
|
|
|
|
# fetch the login page, fill in the form, and submit it (sets the cookie) |
|
|
|
login_page = app.get("/login") |
|
|
|
login_page.form["username"] = "SessionUser" |
|
|
|
login_page.form["password"] = "session user password" |
|
|
|
login_page.form.submit() |
|
|
|
# The login process requires a non-None IP address; this |
|
|
|
# populates `request.client_addr`. |
|
|
|
login_page.form.submit(extra_environ={"HTTP_X_FORWARDED_FOR": "0.0.0.0"}) |
|
|
|
|
|
|
|
yield app |
|
|
|
|
|
|
|
|