Skip to content

Commit acf6bc3

Browse files
committed
more changes
1 parent f178143 commit acf6bc3

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

backend/__init__.py

Whitespace-only changes.
5.67 KB
Binary file not shown.
932 Bytes
Binary file not shown.
5.07 KB
Binary file not shown.

backend/tests/conftest.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
import sys
2+
import os
13
import pytest
2-
from app import app as flask_app
4+
5+
# Add /app to sys.path so we can import app.py
6+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
7+
8+
from app import app as flask_app # ✅ this should now work
9+
10+
11+
312

413
@pytest.fixture
514
def client():

backend/tests/test_basic.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
def test_submit_tax_post(client):
2-
res = client.post("/api/submit-tax", json={"name": "John", "income": 40000})
1+
def test_submit_tax_realistic(client):
2+
payload = {
3+
"filing_status": "single",
4+
"age": 30,
5+
"country": "Greece",
6+
"employment_type": "employee",
7+
"income": 40000,
8+
"work_expenses": 500,
9+
"mortgage_interest": 3000,
10+
"charity_donations": 200,
11+
"education_expenses": 1000,
12+
"retirement_contributions": 800,
13+
"dependents": 1,
14+
}
15+
res = client.post("/api/submit-tax", json=payload)
316
assert res.status_code == 201
417
assert "Received tax info." in res.get_json()["message"]
18+
assert res.get_json()["received"] == payload
19+
520

621
def test_submit_tax_get(client):
722
res = client.get("/api/submit-tax")

0 commit comments

Comments
 (0)