from fastapi.testclient import TestClient

from app.app import app

client = TestClient(app, raise_server_exceptions=False)

def test_legit_date():
    response = client.get("/orders/expired/20210303")
    assert response.status_code == 200

def test_sql_injection():
    response = client.get("/orders/expired/20210303 or (1=1)")
    assert response.status_code == 500
722c1d97d8f9d27e6feb329e1f53a580f6decaf6
<mask token>


def test_legit_date():
    response = client.get('/orders/expired/20210303')
    assert response.status_code == 200


<mask token>

<mask token>


def test_legit_date():
    response = client.get('/orders/expired/20210303')
    assert response.status_code == 200


def test_sql_injection():
    response = client.get('/orders/expired/20210303 or (1=1)')
    assert response.status_code == 500

<mask token>
client = TestClient(app, raise_server_exceptions=False)


def test_legit_date():
    response = client.get('/orders/expired/20210303')
    assert response.status_code == 200


def test_sql_injection():
    response = client.get('/orders/expired/20210303 or (1=1)')
    assert response.status_code == 500

from fastapi.testclient import TestClient
from app.app import app
client = TestClient(app, raise_server_exceptions=False)


def test_legit_date():
    response = client.get('/orders/expired/20210303')
    assert response.status_code == 200


def test_sql_injection():
    response = client.get('/orders/expired/20210303 or (1=1)')
    assert response.status_code == 500

from fastapi.testclient import TestClient

from app.app import app

client = TestClient(app, raise_server_exceptions=False)

def test_legit_date():
    response = client.get("/orders/expired/20210303")
    assert response.status_code == 200

def test_sql_injection():
    response = client.get("/orders/expired/20210303 or (1=1)")
    assert response.status_code == 500