Question
def test_user_login_bad_password(client): with client: response = client.post(/registration, data={ email: steve@steve.com, password: testtest, confirm: testtest, }, follow_redirects=True) assert response.request.path == url_for('authentication.login') assert response.status_code == 200 var
def test_user_login_bad_password(client): with client: response = client.post("/registration", data={ "email": "steve@steve.com", "password": "testtest", "confirm": "testtest", }, follow_redirects=True) assert response.request.path == url_for('authentication.login') assert response.status_code == 200 var = response == client.post("/login", data == { "email": "steve@steve.com", "password": "testtes", }, follow_redirects=True) assert response.request.path == url_for('authentication.login') assert response.status_code == 200 assert b"Password Incorrect" in response.data
PROBLEM
> assert response.request.path == url_for('authentication.login') E AssertionError: assert '/' == '/login' E - /login E + /
2.
def test_sample_calc_route(app, client, login): with app.app_context(): assert SampleCalc.record_count() == 0 with client: response = client.post("/sample_size", data={ "z_score": "2.58", "margin_error": ".05", "std": ".5", "population_size": "425" }, follow_redirects=True) with app.app_context(): assert SampleCalc.record_count() == 1 assert response.status_code == 200 assert response.request.path == url_for('sample_size.my_sample_calcs') assert b"259.39" in response.data with app.app_context(): assert SampleCalc.record_count() == 1
E assert b"259.39" in response.data with app.app_context(): E ^^^^ E SyntaxError: invalid syntax
3.
def test_sample_size_login_redirect_route(client): response = client.post("/registration", data={ "email": "steve@steve.com", "password": "testtest", "confirm": "testtest", }, follow_redirects=True) assert response.status_code == 200 assert response.request.path == url_for('authentication.login') response = client.get("/sample_size", follow_redirects=True) assert response.status_code == 200 assert response.request.path == url_for('authentication.login') response = client.get("/login?next=%2Fsample_size", follow_redirects=True) response = client.post( "/login?next=%2Fsample_size", data=dict(email='steve@steve.com', password='testtest'), follow_redirects=True ) assert response.status_code == 200 assert response.request.path == url_for('sample_size.sample_size_page')
PROBLEM
> assert response.request.path == url_for('authentication.login') E AssertionError: assert '/' == '/login' E - /login E + /
4.
def test_user_profile_model(app, create_5_users): with app.app_context(): assert Profile.record_count() == 0 user = User.find_by_id(1) profile = Profile("Steve","Steve","5555555") user.profile = profile user.save() assert Profile.record_count() == 1 assert user.profile.first_name == "Steve" assert user.profile.last_name == "Steve" assert user.profile.phone == "5555555"
PROBLEM user = User.find_by_id(1) > profile = Profile("Steve","Steve","5555555") E TypeError: __init__() takes 3 positional arguments but 4 were given
5.
def test_user_profile_post_controller(app, client, login): with app.app_context(): assert Profile.record_count() == 0 with client: response = client.post("/profile", data={ "first_name": "Steve", "last_name": "Smith", "phone": "5555555", }, follow_redirects=True) assert response.status_code == 200 with app.app_context(): assert Profile.record_count() == 1
PROBLEM ;
with app.app_context(): > assert Profile.record_count() == 1 E AssertionError: assert 0 == 1 E + where 0 =
test_profile_controller.py:19: AssertionError
5.
def test_user_login_bad_password(client): with client: response = client.post("/registration", data={ "email": "steve@steve.com", "password": "testtest", "confirm": "testtest", }, follow_redirects=True) assert response.request.path == url_for('authentication.login') assert response.status_code == 200 var = response == client.post("/login", data == { "email": "steve@steve.com", "password": "testtes", }, follow_redirects=True) assert response.request.path == url_for('authentication.login') assert response.status_code == 200 assert b"Password Incorrect" in response.data
PROBLEM
}, follow_redirects=True) > assert response.request.path == url_for('authentication.login') E AssertionError: assert '/' == '/login' E - /login E + /
test_login_bad_password.py:19: AssertionError
6.
def test_user_login_dashboard(client, login): client response = client.get("/dashboard", follow_redirects=True) assert response.request.path == url_for('authentication.dashboard') assert response.status_code == 200 assert b"steve@steve.com" in response.data
PROBLEM response = client.get("/dashboard", follow_redirects=True) E IndentationError: unexpected indent
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started