Skip to content

Instantly share code, notes, and snippets.

@mattupstate
Created October 1, 2011 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattupstate/1256722 to your computer and use it in GitHub Desktop.
Save mattupstate/1256722 to your computer and use it in GitHub Desktop.
I'm getting a BrowserStateError for some reason
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