mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-07 21:10:46 -05:00
Update conftest.py
This commit is contained in:
+16
-18
@@ -151,10 +151,9 @@ def test_client(app, user):
|
|||||||
email='john@testclient.com',
|
email='john@testclient.com',
|
||||||
phone='+1 (555) 123-4567',
|
phone='+1 (555) 123-4567',
|
||||||
address='123 Test Street, Test City, TC 12345',
|
address='123 Test Street, Test City, TC 12345',
|
||||||
default_hourly_rate=Decimal('85.00'),
|
default_hourly_rate=Decimal('85.00')
|
||||||
status='active',
|
|
||||||
created_by=user.id
|
|
||||||
)
|
)
|
||||||
|
client.status = 'active' # Set after creation
|
||||||
db.session.add(client)
|
db.session.add(client)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
@@ -166,16 +165,15 @@ def test_client(app, user):
|
|||||||
def multiple_clients(app, user):
|
def multiple_clients(app, user):
|
||||||
"""Create multiple test clients."""
|
"""Create multiple test clients."""
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
clients = [
|
clients = []
|
||||||
Client(
|
for i in range(1, 4):
|
||||||
|
client = Client(
|
||||||
name=f'Client {i}',
|
name=f'Client {i}',
|
||||||
email=f'client{i}@example.com',
|
email=f'client{i}@example.com',
|
||||||
default_hourly_rate=Decimal('75.00') + Decimal(i * 10),
|
default_hourly_rate=Decimal('75.00') + Decimal(i * 10)
|
||||||
created_by=user.id,
|
|
||||||
status='active'
|
|
||||||
)
|
)
|
||||||
for i in range(1, 4)
|
client.status = 'active' # Set after creation
|
||||||
]
|
clients.append(client)
|
||||||
db.session.add_all(clients)
|
db.session.add_all(clients)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
@@ -198,9 +196,9 @@ def project(app, test_client):
|
|||||||
client_id=test_client.id,
|
client_id=test_client.id,
|
||||||
description='Test project description',
|
description='Test project description',
|
||||||
billable=True,
|
billable=True,
|
||||||
hourly_rate=Decimal('75.00'),
|
hourly_rate=Decimal('75.00')
|
||||||
status='active'
|
|
||||||
)
|
)
|
||||||
|
project.status = 'active' # Set after creation
|
||||||
db.session.add(project)
|
db.session.add(project)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
@@ -212,17 +210,17 @@ def project(app, test_client):
|
|||||||
def multiple_projects(app, test_client):
|
def multiple_projects(app, test_client):
|
||||||
"""Create multiple test projects."""
|
"""Create multiple test projects."""
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
projects = [
|
projects = []
|
||||||
Project(
|
for i in range(1, 4):
|
||||||
|
project = Project(
|
||||||
name=f'Project {i}',
|
name=f'Project {i}',
|
||||||
client_id=test_client.id,
|
client_id=test_client.id,
|
||||||
description=f'Test project {i}',
|
description=f'Test project {i}',
|
||||||
billable=True,
|
billable=True,
|
||||||
hourly_rate=Decimal('75.00'),
|
hourly_rate=Decimal('75.00')
|
||||||
status='active'
|
|
||||||
)
|
)
|
||||||
for i in range(1, 4)
|
project.status = 'active' # Set after creation
|
||||||
]
|
projects.append(project)
|
||||||
db.session.add_all(projects)
|
db.session.add_all(projects)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user