예제 #1
0
def test_ricotta_post_boiling_plan(client):
    filepath = client.config["TEST_RICOTTA"]
    with client.test_client() as client:
        url = url_for("main.ricotta_boiling_plan", _external=False)
        data = {"date": "2021-01-01", "submit": "submit"}
        with open(filepath, 'rb') as f:
            data['input_file'] = (io.BytesIO(f.read()), "ricotta.xlsx")
        response = client.post(
            url, data=data, follow_redirects=True, content_type='multipart/form-data'
        )
        assert response.status_code == 200
예제 #2
0
def test_butter_post_schedule(client):
    filepath = client.config["TEST_BUTTER"]
    with client.test_client() as client:
        url = url_for("main.butter_schedule", _external=False)
        data = {
            "date": "2021-01-01",
            "batch_number": 1,
            "beg_time": "07:00",
            "submit": "submit"
        }
        with open(filepath, 'rb') as f:
            data['input_file'] = (io.BytesIO(f.read()), "butter.xlsx")
        response = client.post(url,
                               data=data,
                               follow_redirects=True,
                               content_type='multipart/form-data')
        assert response.status_code == 200
예제 #3
0
def test_butter_get_boiling_plan(client):
    with client.test_client() as client:
        url = url_for("main.butter_boiling_plan", _external=False)
        response = client.get(url)
        assert response.status_code == 200
예제 #4
0
def test_mozzarella_params(client):
    with client.test_client() as client:
        url = url_for("main.mozzarella_params", _external=False)
        response = client.get(url)
        assert response.status_code == 200
예제 #5
0
def test_mozzarella_get_schedule(client):
    with client.test_client() as client:
        url = url_for("main.mozzarella_schedule", _external=False)
        print(url)
        response = client.get(url)
        assert response.status_code == 200
예제 #6
0
def test_mascarpone_get_schedule(client):
    with client.test_client() as client:
        url = url_for("main.mascarpone_schedule", _external=False)
        response = client.get(url)
        assert response.status_code == 200
예제 #7
0
def test_save_batches(client):
    with client.test_client() as client:
        url = url_for("main.save_batches", _external=False)
        response = client.get(url)
        assert response.status_code == 200
예제 #8
0
def test_empty_db(client):
    with client.test_client() as client:
        response = client.get('/')

        assert response.status_code == 200