Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 32 lines (21 sloc) 0.719 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/usr/bin/env python

"""Tests for the Flask Heroku template."""

import unittest
from app import create_app


class TestApp(unittest.TestCase):

    def setUp(self):
        app = create_app()
        self.app = app.test_client()

    def test_home_page_works(self):
        rv = self.app.get('/')
        self.assertTrue(rv.data)
        self.assertEquals(rv.status_code, 200)

    def test_404_page(self):
        rv = self.app.get('/i-am-not-found/')
        self.assertEquals(rv.status_code, 404)

    def test_static_text_file_request(self):
        rv = self.app.get('/humans.txt')
        self.assertTrue(rv.data)
        self.assertEquals(rv.status_code, 200)


if __name__ == '__main__':
    unittest.main()
Something went wrong with that request. Please try again.