forked from Anteros-Code-Mentoria/poc-mvc-ocr
12 lines
350 B
Python
12 lines
350 B
Python
from tests.factories import InvoiceFactory
|
|
|
|
def test_get_invoices(client, db_session):
|
|
"""Testa a listagem de faturas"""
|
|
InvoiceFactory.create_batch(2) # Cria 2 faturas fictícias
|
|
db_session.commit()
|
|
|
|
response = client.get("/invoices/")
|
|
assert response.status_code == 200
|
|
data = response.get_json()
|
|
assert len(data) == 2
|