Created
October 1, 2011 22:11
-
-
Save mattupstate/1256722 to your computer and use it in GitHub Desktop.
I'm getting a BrowserStateError for some reason
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from flask import Flask, render_template | |
from flaskext.testing import TestCase, Twill | |
TWILL_ENABLED = True | |
DEBUG = True | |
SECRET_KEY = 'secret' | |
def create_app(): | |
app = Flask(__name__) | |
app.config.from_object(__name__) | |
@app.route('/') | |
def home(): | |
return render_template('login.html') | |
return app | |
class TestViews(TestCase, Twill): | |
def create_app(self): | |
app = create_app() | |
self.twill = Twill(app) | |
return app | |
def test_manually(self): | |
self.twill.browser.go(self.twill.url("/")) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment