<s> from flask import url_for <EOL> from flask . ext . testing import TestCase <EOL> class BasicTestCase ( TestCase ) : <EOL> def create_app ( self ) : <EOL> try : <EOL> import local_settings as settings <EOL> except ImportError : <EOL> import settings <EOL> settings . MONGODB_SETTINGS [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> settings . ENABLE_FIXTURES_ENDPOINTS = True <EOL> import app as unshred <EOL> return unshred . app <EOL> def create_user_and_login ( self , username = "<STR_LIT:user>" ) : <EOL> self . client . post ( url_for ( "<STR_LIT>" ) ) <EOL> self . client . post ( url_for ( "<STR_LIT>" , username = username ) ) <EOL> def is_user_logged ( self ) : <EOL> with self . client . session_transaction ( ) as session : <EOL> return "<STR_LIT>" in session </s>
