import pytest from app import app @pytest.fixture def client(): app.config['TESTING'] =…
Jump to turn (10)
- 1import pytest from app import app @pytest.fixture def client(): app.config['TEST
- 2from flask import Blueprint, rendertemplate, request, jsonify, redirect, urlfor
- 3how can i better this routes?
- 4could you do some of this changes/melhorias?
- 5need to create a logging file?
- 6my app.py now from flask import Flask from routes import predictionroutes from l
- 7@predictionroutes.route('/result', methods=['GET']) def result(): try: predicted
- 8from flask import Blueprint, rendertemplate, request, jsonify, redirect, urlfor
- 9from flask import Blueprint, rendertemplate, request, jsonify, redirect, urlfor
- 10how can i add a logg when the submit has ben received successfully? and the apir
- User
import pytest from app import app
@pytest.fixture def client(): app.config['TESTING'] = True with app.test_client() as client: yield client
- Assistant
def test_homepage(client): response = client.get('/') assert response.status_code == 200 assert b"Welcome to the homepage" in response.data
def test_about_page(client): response = client.get('/about') assert response.status_code == 200 assert b"About Us" in response.data
def test_contact_page(client): response = client.get('/contact') assert response.status_code == 200 assert b"Contact Us" in response.data
def test_invalid_page(client): response = client.get('/invalid') assert response.status_code == 404
- User