Loading...
 

Flask Unit Testing

Table of contents

References

Tests

from flask import Flask, url_for
from flask_testing import TestCase


class AppTest(TestCase):

    def create_app(self):

        app = Flask(__name__)
        app.config['TESTING'] = True
        return app

    def test_home_page_200(self):
        response = self.app.test_client().get('/')
        self.assertEqual(response.status_code, 200)


Last edited by MichaelAlber .
Page last modified on Sunday November 4, 2018 12:56:03 UTC.