I have added a small Flask extension to Bitbucket:
http://bitbucket.org/danjac/flask-unit
Flask-unit is a subclass of unittest.TestCase. It is based on this
snippet: http://flask.pocoo.org/snippets/26/
The TestCase does all the required application and context setup, and
includes some utility functions for checking redirect URLs etc.
You define a create_app() method in your TestCase. For example:
class MyTest(TestCase):
def create_app(self):
app = Flask(__name__)
return app
def test_something(self):
assert self.app
A test client is automatically created and stored as self.client. In
addition the test context is automatically created and disposed.
Hi, On 6/23/10 10:01 AM, Dan Jacob wrote: > I have added a small Flask extension to Bitbucket: > > http://bitbucket.org/danjac/flask-unit What about renaming that to flask-testing and also add support for twill in there? Regards, Armin
Sure, I wasn't sure whether to explicitly mention it was using unittest or not. What ideas do you have for twill support ? On 23 June 2010 09:04, Armin Ronacher <armin.ronacher@active-4.com> wrote: > Hi, > > > On 6/23/10 10:01 AM, Dan Jacob wrote: >> I have added a small Flask extension to Bitbucket: >> >> http://bitbucket.org/danjac/flask-unit > What about renaming that to flask-testing and also add support for twill > in there? > > > Regards, > Armin >
Name changed to flask-testing. On 23 June 2010 09:08, Dan Jacob <danjac354@gmail.com> wrote: > Sure, I wasn't sure whether to explicitly mention it was using unittest or not. > > What ideas do you have for twill support ? > > On 23 June 2010 09:04, Armin Ronacher <armin.ronacher@active-4.com> wrote: >> Hi, >> >> >> On 6/23/10 10:01 AM, Dan Jacob wrote: >>> I have added a small Flask extension to Bitbucket: >>> >>> http://bitbucket.org/danjac/flask-unit >> What about renaming that to flask-testing and also add support for twill >> in there? >> >> >> Regards, >> Armin >> >