Skip to content

Commit

Permalink
added print to check response data for debug
Browse files Browse the repository at this point in the history
added code to check login successful
  • Loading branch information
taka-rl committed Oct 15, 2024
1 parent 126aeed commit 2230d94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ def runner(app):
@pytest.fixture
def super_admin_client(client):
"""Log in as the super admin and return the authenticated client."""
client.post('/login', data={
login_response = client.post('/login', data={
'email': SUPER_ADMIN_EMAIL,
'password': SUPER_ADMIN_PASSWORD
})
}, follow_redirects=True)

# Make sure if login was successful
assert login_response.status_code == 200
return client
3 changes: 3 additions & 0 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ def test_check_super_admin_exist(client):

def test_admin_dashboard_access(super_admin_client):
response = super_admin_client.get('/admin-dashboard')

print(response.data) # Add logging for debugging

assert response.status_code == 200 # Check if registration redirects after success
assert b'Admin Dashboard' in response.data

Expand Down

0 comments on commit 2230d94

Please sign in to comment.