import os
import django

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'branch_system.settings')
django.setup()

from django.test import Client

client = Client()

# Try to login with the created superuser
response = client.post('/login/', {
    'username': 'admin',
    'password': 'admin123'
}, follow=True)

print(f"Status: {response.status_code}")
print(f"Redirected to: {response.redirect_chain}")
if response.status_code == 200:
    print("Login successful!")
else:
    print("Login failed")
