Skip to content
Open
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
2 changes: 1 addition & 1 deletion test_admin_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_admin_login():
print("Testing admin login...")

# Test database connection
conn = sqlite3.connect('ams.db')
conn = sqlite3.connect(os.path.join(os.path.dirname(os.path.abspath(_ _file_ _)), 'ams.db'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT BUG Fix _ _file_ _ typo — should be __file__

_ _file_ _ with spaces is a SyntaxError; Python can't parse two adjacent identifiers. The test file will fail to import entirely. Line 8 already shows the correct spelling: __file__.

Suggested change
conn = sqlite3.connect(os.path.join(os.path.dirname(os.path.abspath(_ _file_ _)), 'ams.db'))
conn = sqlite3.connect(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ams.db'))
Prompt to fix with AI

Copy this prompt into your AI coding assistant to fix this issue.

In file `test_admin_routes.py` at line 19, replace `_ _file_ _` (with spaces) with `__file__` (no spaces). The current text `os.path.abspath(_ _file_ _)` is a SyntaxError. The corrected line should read: `conn = sqlite3.connect(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ams.db'))`

cursor = conn.cursor()

# Check if admin exists
Expand Down
Loading