MagicFaceTG / test_db.py
rastof9's picture
Create test_db.py
4f1c462 verified
raw
history blame contribute delete
710 Bytes
# test_db.py
import database
print("--- Testing Database Connection ---")
# Use a dummy user ID and username for the test
test_user_id = 12345
test_username = "testuser"
print(f"Attempting to get or create user: {test_user_id} ({test_username})")
user_data = database.get_or_create_user(test_user_id, test_username)
if user_data:
print("\n✅ Test successful!")
print("Received user data:")
print(user_data)
print("\nCheck your 'users' table in the Supabase dashboard. You should see a new entry for 'testuser'.")
else:
print("\n❌ Test failed. Please check the error messages above.")
print("Common issues include incorrect URL/Key in config.py or network connectivity problems.")