18 lines
516 B
Python
18 lines
516 B
Python
from app.models.company import Company
|
|
from app.services.sync_service import SyncService
|
|
|
|
|
|
def test_health(client):
|
|
response = client.get('/api/health')
|
|
assert response.status_code == 200
|
|
assert response.json['db'] == 'ok'
|
|
|
|
|
|
def test_api_invoices(auth_client, app):
|
|
with app.app_context():
|
|
company = Company.query.first()
|
|
SyncService(company).run_manual_sync()
|
|
response = auth_client.get('/api/invoices')
|
|
assert response.status_code == 200
|
|
assert 'items' in response.json
|