Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolved test-app pylint errors #46

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def test_filter_jobs_route(self):
"dept_filter": "Engineering",
"company_filter": "TechCorp"
})
assert response.status_code == 200
assert response.status_code == 200

def test_view_forum_topic_route(self):
"""Test viewing a specific forum topic."""
Expand All @@ -520,20 +520,23 @@ def test_my_jobs_route(self):
assert response.status_code == 200

def test_get_user_logged_in(self):
"""Test for logging in users."""
with self.client as client:
with client.session_transaction() as session:
session['username'] = 'testuser'
response = client.get('/api/getUser')
assert response.status_code == 200
assert response.json == 'testuser'

def test_get_user_not_logged_in(self):
"""Test for wgat if user not logged in."""
with self.client as client:
response = client.get('/api/getUser')
assert response.status_code == 200
assert response.json == ''

def test_get_user_session_key_none(self):
"""Test for None user."""
with self.client as client:
with client.session_transaction() as session:
session['username'] = None
Expand Down
Loading