Update flask_container_ci challenge
This commit is contained in:
@@ -1,27 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from config import basedir
|
||||
from app import app
|
||||
from app import db
|
||||
from app import main
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
app.config['TESTING'] = True
|
||||
app.config['WTF_CSRF_ENABLED'] = False
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(
|
||||
basedir, 'test.db')
|
||||
self.app = app.test_client()
|
||||
db.create_all()
|
||||
self.app = main.app.test_client()
|
||||
|
||||
def tearDown(self):
|
||||
db.session.remove()
|
||||
db.drop_all()
|
||||
def test_main_page(self):
|
||||
response = self.app.get('/', follow_redirects=True)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def test_users_page(self):
|
||||
response = self.app.get('/users', follow_redirects=True)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user