code errors at #400

arohacs opened this Issue Feb 7, 2012 · 5 comments


None yet

5 participants

arohacs commented Feb 7, 2012

The app as constructed by the code on the page will fail all 3 tests. I copied the source file at and it runs all tests successfully. A vimdiff showed the following issues between the files (I hope the formatting isn't mangled too badly - if so, it's not hard to copy, paste, and do another vimdiff):

source file from github: code from tutorial:

def tearDown(self): def tearDown(self):
"""Get rid of the database again after each test

os.unlink(['DATABASE'])                             os.unlink(flaskr.DATABASE) 
os.unlink(['DATABASE'])                             os.unlink(flaskr.DATABASE)  

def test_login_logout(self): def test_login_logout(self):
"""Make sure login and logout works"""
rv = self.login(['USERNAME'], rv = self.login('admin', 'default')['PASSWORD'])

rv = self.login(['USERNAME'] +                   rv = self.login('adminx', 'default')            

rv = self.login(['USERNAME'],                     rv = self.login('admin', 'defaultx')            
            ['PASSWORD'] +         

def test_messages(self): def test_messages(self):
"""Test that messages work""" self.login('admin', 'default')

rduplain commented Feb 7, 2012

Thanks for reporting this. Any interest in posting a pull request? I'll file another issue to run the example tests in the Flask core test runner.


arohacs commented Feb 7, 2012

Sure, I'd be happy to help, but I'm a bit new with github. Please excuse my newness - how should I go about this?



rduplain commented Feb 7, 2012

This is a good opportunity to get into git/github. Start here:

I'm always online on IRC, though not always at the keyboard. I'm rduplain.

You'll also find a lot of help/fast-response online for general git/github questions. If you decide to pass, just let me know and I'll apply your diff.


remram44 commented Aug 8, 2014

The flaskr example doesn't seem to run at all now:

Traceback (most recent call last):
  File "", line 12, in <module>
    import flaskr
  File "flask/examples/flaskr/", line 48, in <module>
AttributeError: 'Flask' object has no attribute 'cli'

@remram44 this is because you are using Flaskr from the master branch and have a different version of Flask installed.

@DasIch DasIch closed this Aug 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment