-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathtest_jinja_variable.py
More file actions
32 lines (27 loc) · 1.07 KB
/
test_jinja_variable.py
File metadata and controls
32 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
REGISTER_DETAIL = {
"username": "correct_user",
"full_name": "full_name",
"password": "correct_password",
"confirm_password": "correct_password",
"email": "example@email.com",
"description": "",
}
LOGIN_DATA = {"username": "correct_user", "password": "correct_password"}
def test_user_not_logged_in(session, security_test_client):
security_test_client.get(security_test_client.app.url_path_for("logout"))
response = security_test_client.get("/about")
assert b"Sign Out" not in response.content
assert b"Sign In" in response.content
def test_user_is_logged_in(session, security_test_client):
security_test_client.get(security_test_client.app.url_path_for("logout"))
security_test_client.post(
security_test_client.app.url_path_for("register"),
data=REGISTER_DETAIL,
)
security_test_client.post(
security_test_client.app.url_path_for("login"),
data=LOGIN_DATA,
)
response = security_test_client.get("/about")
assert b"Sign Out" in response.content
assert b"Sign In" not in response.content