push
This commit is contained in:
17
tests/test_api.py
Normal file
17
tests/test_api.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
Reference in New Issue
Block a user