Refactored Database management to allow isolated integration tests
This commit is contained in:
61
tests/fixtures/test_users.py
vendored
Normal file
61
tests/fixtures/test_users.py
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"""Test user definitions for E2E authentication testing"""
|
||||
|
||||
|
||||
class TestUsers:
|
||||
"""Class containing test user data"""
|
||||
|
||||
# Admin user (automatically created on startup)
|
||||
ADMIN = {
|
||||
"email": "test.admin@test.com",
|
||||
"password": "TestAdmin123"
|
||||
}
|
||||
|
||||
# Regular user to create for certain tests
|
||||
REGULAR_USER = {
|
||||
"username": "testuser",
|
||||
"email": "user@test.com",
|
||||
"password": "TestUser123"
|
||||
}
|
||||
|
||||
# Failed authentication test cases
|
||||
INVALID_CREDENTIALS = [
|
||||
{
|
||||
"name": "wrong_password",
|
||||
"email": "test.admin@test.com",
|
||||
"password": "wrongpass",
|
||||
"expected_error": "Invalid email or password"
|
||||
},
|
||||
{
|
||||
"name": "nonexistent_user",
|
||||
"email": "nonexistent@test.com",
|
||||
"password": "TestAdmin123",
|
||||
"expected_error": "Invalid email or password"
|
||||
},
|
||||
{
|
||||
"name": "invalid_email_format",
|
||||
"email": "invalid.email",
|
||||
"password": "TestAdmin123",
|
||||
"expected_error": "Invalid email or password"
|
||||
},
|
||||
{
|
||||
"name": "empty_email",
|
||||
"email": "",
|
||||
"password": "TestAdmin123",
|
||||
"expected_error": "Email and password are required"
|
||||
},
|
||||
{
|
||||
"name": "empty_password",
|
||||
"email": "test.admin@test.com",
|
||||
"password": "",
|
||||
"expected_error": "Email and password are required"
|
||||
}
|
||||
]
|
||||
|
||||
# Protected URLs to test for unauthorized access
|
||||
PROTECTED_URLS = [
|
||||
"/",
|
||||
"/admin",
|
||||
"/repositories",
|
||||
"/workflows",
|
||||
"/applications"
|
||||
]
|
||||
Reference in New Issue
Block a user